@Test public void overlayProfiles() { Profile p1 = ProfileBuilder.Factory.create("p1") .addAttribute("p1a1", "p1v1") .addConfiguration("p1p1", "p1p1p1", "p1p1v1") .addConfiguration("pp1", "pp1p1", "p1p1v1") .getProfile(); Profile p2 = ProfileBuilder.Factory.create("p2") .addAttribute("p2a1", "p2v1") .addConfiguration("p2p1", "p2p1p1", "p2p1v1") .addConfiguration("pp1", "pp1p1", "p2p1v1") .getProfile(); Profile c1 = ProfileBuilder.Factory.create("c2") .addParents(Arrays.asList("p1", "p2")) .getProfile(); assertThat(c1.getAttributes().get("p1a1"), nullValue()); assertThat(c1.getAttributes().get("p2a1"), nullValue()); assertThat(c1.getConfigurations().size(), equalTo(1)); assertTrue(c1.getConfigurations().containsKey("profile")); Map<String, Profile> parents = new LinkedHashMap<>(); parents.put("p1", p1); parents.put("p2", p2); Profile oc1 = Profiles.getOverlay(c1, parents); assertThat(oc1.getAttributes().get("p1a1"), equalTo("p1v1")); assertThat(oc1.getAttributes().get("p2a1"), equalTo("p2v1")); assertThat(oc1.getConfigurations().size(), equalTo(4)); assertTrue(oc1.getConfigurations().containsKey("p1p1")); assertTrue(oc1.getConfigurations().containsKey("p2p1")); assertTrue(oc1.getConfigurations().containsKey("pp1")); assertTrue(oc1.getConfigurations().containsKey("profile")); }
public static Profile getOverlay(Profile profile, Map<String, Profile> profiles) { return getOverlay(profile, profiles, null); }
Profiles { public static Profile getOverlay(Profile profile, Map<String, Profile> profiles) { return getOverlay(profile, profiles, null); } }
Profiles { public static Profile getOverlay(Profile profile, Map<String, Profile> profiles) { return getOverlay(profile, profiles, null); } private  Profiles(); }
Profiles { public static Profile getOverlay(Profile profile, Map<String, Profile> profiles) { return getOverlay(profile, profiles, null); } private  Profiles(); static Map<String, Profile> loadProfiles(final Path root); static void deleteProfile(Path root, String id); static void writeProfile(Path root, Profile profile); static Profile getOverlay(Profile profile, Map<String, Profile> profiles); static Profile getOverlay(Profile profile, Map<String, Profile> profiles, String environment); static Profile getEffective(final Profile profile); static Profile getEffective(final Profile profile, boolean finalSubstitution); static Profile getEffective(final Profile profile,
                                       final Collection<PlaceholderResolver> resolvers); static Profile getEffective(final Profile profile,
                                       final Collection<PlaceholderResolver> resolvers,
                                       boolean finalSubstitution); }
Profiles { public static Profile getOverlay(Profile profile, Map<String, Profile> profiles) { return getOverlay(profile, profiles, null); } private  Profiles(); static Map<String, Profile> loadProfiles(final Path root); static void deleteProfile(Path root, String id); static void writeProfile(Path root, Profile profile); static Profile getOverlay(Profile profile, Map<String, Profile> profiles); static Profile getOverlay(Profile profile, Map<String, Profile> profiles, String environment); static Profile getEffective(final Profile profile); static Profile getEffective(final Profile profile, boolean finalSubstitution); static Profile getEffective(final Profile profile,
                                       final Collection<PlaceholderResolver> resolvers); static Profile getEffective(final Profile profile,
                                       final Collection<PlaceholderResolver> resolvers,
                                       boolean finalSubstitution); static final String PROFILE_FOLDER_SUFFIX; }