@Test public void testProfilesOverlayComments() { String pid1 = "# My comment\nfoo = bar\n"; Profile parent = ProfileBuilder.Factory.create("parent") .addFileConfiguration("pid1.cfg", pid1.getBytes()) .getProfile(); Profile profile = ProfileBuilder.Factory.create("test") .addConfiguration("pid1", "foo", "bar2") .addParent("parent") .getProfile(); Map<String, Profile> profiles = new HashMap<>(); profiles.put(parent.getId(), parent); profiles.put(profile.getId(), profile); Profile overlay = Profiles.getOverlay(profile, profiles); String outPid1 = new String(overlay.getFileConfiguration("pid1.cfg")); assertEquals(String.format("%1$s%n%2$s%n","# My comment","foo = bar2"), outPid1); }
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; }