@Test public void testPutAllWithDefaults(){ Properties c = make(MAP_C, null, !UNMODIFIABLE); Properties ab = make(MAP_A, make(MAP_B, null, UNMODIFIABLE), UNMODIFIABLE); PropertiesUtils.putAll(c, ab); assertTrue(verifyProps(c, LIST_ABC)); }
public static void putAll(Properties addToThis, Properties withThese) { if ( withThese != null && addToThis != null ) { Enumeration<?> enumeration = withThese.propertyNames(); while ( enumeration.hasMoreElements() ) { String propName = (String) enumeration.nextElement(); Object propValue = withThese.get(propName); if ( propValue == null ) { propValue = withThese.getProperty(propName); } if ( propValue != null ) { addToThis.put(propName, propValue); } } } }
PropertiesUtils { public static void putAll(Properties addToThis, Properties withThese) { if ( withThese != null && addToThis != null ) { Enumeration<?> enumeration = withThese.propertyNames(); while ( enumeration.hasMoreElements() ) { String propName = (String) enumeration.nextElement(); Object propValue = withThese.get(propName); if ( propValue == null ) { propValue = withThese.getProperty(propName); } if ( propValue != null ) { addToThis.put(propName, propValue); } } } } }
PropertiesUtils { public static void putAll(Properties addToThis, Properties withThese) { if ( withThese != null && addToThis != null ) { Enumeration<?> enumeration = withThese.propertyNames(); while ( enumeration.hasMoreElements() ) { String propName = (String) enumeration.nextElement(); Object propValue = withThese.get(propName); if ( propValue == null ) { propValue = withThese.getProperty(propName); } if ( propValue != null ) { addToThis.put(propName, propValue); } } } }  }
PropertiesUtils { public static void putAll(Properties addToThis, Properties withThese) { if ( withThese != null && addToThis != null ) { Enumeration<?> enumeration = withThese.propertyNames(); while ( enumeration.hasMoreElements() ) { String propName = (String) enumeration.nextElement(); Object propValue = withThese.get(propName); if ( propValue == null ) { propValue = withThese.getProperty(propName); } if ( propValue != null ) { addToThis.put(propName, propValue); } } } }  static Properties clone( Properties props ); static Properties clone( Properties props, Properties defaults, boolean deepClone ); static void putAll(Properties addToThis,
                              Properties withThese); static int getIntProperty(Properties props, String propName, int defaultValue); static long getLongProperty(Properties props, String propName, long defaultValue); static float getFloatProperty(Properties props, String propName, float defaultValue); static double getDoubleProperty(Properties props, String propName, double defaultValue); static boolean getBooleanProperty(Properties props, String propName, boolean defaultValue); static Properties load(String fileName); static char toHex(int nibble); static String toHex(byte[] bytes); static byte[] fromHex(String hex); static void toHex(StringBuilder sb, InputStream is); static void setBeanProperties(Object bean, Properties props, String prefix); static void setBeanProperties(Object bean, Properties props, String prefix, boolean includeEnv); static void setBeanProperty(Object bean, String name, Object value); static String getHierarchicalProperty(String key, String defaultValue); static T getHierarchicalProperty(String key, T defaultValue, Class<T> clazz); static Properties getDefaultProperties(); }
PropertiesUtils { public static void putAll(Properties addToThis, Properties withThese) { if ( withThese != null && addToThis != null ) { Enumeration<?> enumeration = withThese.propertyNames(); while ( enumeration.hasMoreElements() ) { String propName = (String) enumeration.nextElement(); Object propValue = withThese.get(propName); if ( propValue == null ) { propValue = withThese.getProperty(propName); } if ( propValue != null ) { addToThis.put(propName, propValue); } } } }  static Properties clone( Properties props ); static Properties clone( Properties props, Properties defaults, boolean deepClone ); static void putAll(Properties addToThis,
                              Properties withThese); static int getIntProperty(Properties props, String propName, int defaultValue); static long getLongProperty(Properties props, String propName, long defaultValue); static float getFloatProperty(Properties props, String propName, float defaultValue); static double getDoubleProperty(Properties props, String propName, double defaultValue); static boolean getBooleanProperty(Properties props, String propName, boolean defaultValue); static Properties load(String fileName); static char toHex(int nibble); static String toHex(byte[] bytes); static byte[] fromHex(String hex); static void toHex(StringBuilder sb, InputStream is); static void setBeanProperties(Object bean, Properties props, String prefix); static void setBeanProperties(Object bean, Properties props, String prefix, boolean includeEnv); static void setBeanProperty(Object bean, String name, Object value); static String getHierarchicalProperty(String key, String defaultValue); static T getHierarchicalProperty(String key, T defaultValue, Class<T> clazz); static Properties getDefaultProperties();  }