@Test public void testGetValueWithType() { Map<String, String> properties = new HashMap<>(); final String key = "my.property"; properties.put(key, "15"); assertEquals("15", PropertiesHelper.getValue(properties, key, String.class, null)); assertEquals(Integer.valueOf(15), PropertiesHelper.getValue(properties, key, Integer.class, null)); assertEquals(Long.valueOf(15), PropertiesHelper.getValue(properties, key, Long.class, null)); }
public static <T> T getValue(Map<String, ?> properties, String key, T defaultValue, Map<String, String> legacyMap) { return getValue(properties, null, key, defaultValue, legacyMap); }
PropertiesHelper { public static <T> T getValue(Map<String, ?> properties, String key, T defaultValue, Map<String, String> legacyMap) { return getValue(properties, null, key, defaultValue, legacyMap); } }
PropertiesHelper { public static <T> T getValue(Map<String, ?> properties, String key, T defaultValue, Map<String, String> legacyMap) { return getValue(properties, null, key, defaultValue, legacyMap); } private  PropertiesHelper(); }
PropertiesHelper { public static <T> T getValue(Map<String, ?> properties, String key, T defaultValue, Map<String, String> legacyMap) { return getValue(properties, null, key, defaultValue, legacyMap); } private  PropertiesHelper(); static PrivilegedAction<Properties> getSystemProperties(); static PrivilegedAction<String> getSystemProperty(final String name); static PrivilegedAction<String> getSystemProperty(final String name, final String def); static T getValue(Map<String, ?> properties, String key, T defaultValue, Map<String, String> legacyMap); @SuppressWarnings("unchecked") static T getValue(Map<String, ?> properties,
                                 RuntimeType runtimeType,
                                 String key,
                                 T defaultValue,
                                 Map<String, String> legacyMap); static T getValue(Map<String, ?> properties,
                                 String key,
                                 T defaultValue,
                                 Class<T> type,
                                 Map<String, String> legacyMap); static T getValue(Map<String, ?> properties, RuntimeType runtimeType, String key,
                                 T defaultValue, Class<T> type, Map<String, String> legacyMap); static T getValue(Map<String, ?> properties, String key, Class<T> type, Map<String, String> legacyMap); static T getValue(Map<String, ?> properties, RuntimeType runtimeType, String key, Class<T> type,
                                 Map<String, String> legacyMap); static String getPropertyNameForRuntime(String key, RuntimeType runtimeType); static T convertValue(Object value, Class<T> type); static boolean isProperty(final Map<String, Object> properties, final String name); static boolean isProperty(final Object value); }
PropertiesHelper { public static <T> T getValue(Map<String, ?> properties, String key, T defaultValue, Map<String, String> legacyMap) { return getValue(properties, null, key, defaultValue, legacyMap); } private  PropertiesHelper(); static PrivilegedAction<Properties> getSystemProperties(); static PrivilegedAction<String> getSystemProperty(final String name); static PrivilegedAction<String> getSystemProperty(final String name, final String def); static T getValue(Map<String, ?> properties, String key, T defaultValue, Map<String, String> legacyMap); @SuppressWarnings("unchecked") static T getValue(Map<String, ?> properties,
                                 RuntimeType runtimeType,
                                 String key,
                                 T defaultValue,
                                 Map<String, String> legacyMap); static T getValue(Map<String, ?> properties,
                                 String key,
                                 T defaultValue,
                                 Class<T> type,
                                 Map<String, String> legacyMap); static T getValue(Map<String, ?> properties, RuntimeType runtimeType, String key,
                                 T defaultValue, Class<T> type, Map<String, String> legacyMap); static T getValue(Map<String, ?> properties, String key, Class<T> type, Map<String, String> legacyMap); static T getValue(Map<String, ?> properties, RuntimeType runtimeType, String key, Class<T> type,
                                 Map<String, String> legacyMap); static String getPropertyNameForRuntime(String key, RuntimeType runtimeType); static T convertValue(Object value, Class<T> type); static boolean isProperty(final Map<String, Object> properties, final String name); static boolean isProperty(final Object value);  }