@Test public void inheritanceOrder() { Profile gp1 = ProfileBuilder.Factory.create("gp1") .addAttribute("a", "1") .addFileConfiguration("f", new byte[] { 0x01 }) .addAttribute("b", "1") .addAttribute("c", "1") .addConfiguration("p", "p", "1") .addConfiguration("p", "px", "1") .getProfile(); Profile gp2 = ProfileBuilder.Factory.create("gp2") .addAttribute("a", "2") .addAttribute("c", "2") .addFileConfiguration("f", new byte[] { 0x02 }) .addConfiguration("p", "p", "2") .getProfile(); Profile p1 = ProfileBuilder.Factory.create("p1") .addParents(Arrays.asList("gp1", "gp2")) .addAttribute("a", "3") .addFileConfiguration("f", new byte[] { 0x03 }) .addConfiguration("p", "p", "3") .getProfile(); Profile p2 = ProfileBuilder.Factory.create("p2") .addAttribute("a", "4") .addAttribute("b", "4") .addFileConfiguration("f", new byte[] { 0x04 }) .addConfiguration("p", "p", "4") .getProfile(); Profile c = ProfileBuilder.Factory.create("p2") .addParents(Arrays.asList("p1", "p2")) .addAttribute("a", "5") .addFileConfiguration("f", new byte[] { 0x05 }) .addConfiguration("p", "p", "5") .getProfile(); Map<String, Profile> parents = new LinkedHashMap<>(); parents.put("gp1", gp1); parents.put("gp2", gp2); parents.put("p1", p1); parents.put("p2", p2); Profile overlay = Profiles.getOverlay(c, parents); assertThat(overlay.getAttributes().get("a"), equalTo("5")); assertThat(overlay.getAttributes().get("b"), equalTo("4")); assertThat(overlay.getAttributes().get("c"), equalTo("2")); assertThat(overlay.getConfiguration("p").get("p"), equalTo("5")); assertThat(overlay.getConfiguration("p").get("px"), equalTo("1")); assertThat(overlay.getFileConfiguration("f"), equalTo(new byte[] { 0x05 })); }
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; }