@Test public void testMultiValuePropertyAsArray() { assertEquals(Arrays.asList("a", "b"), PropertyHelper.getMultiValueProperty(new String[]{"a", "b"})); }
@SuppressWarnings("unchecked") public static Collection<String> getMultiValueProperty(Object property) { if (property == null) { return Collections.emptyList(); } else if (property instanceof Collection) { return (Collection<String>)property; } else if (property instanceof String[]) { return Arrays.asList((String[])property); } else { return Collections.singleton(property.toString()); } }
PropertyHelper { @SuppressWarnings("unchecked") public static Collection<String> getMultiValueProperty(Object property) { if (property == null) { return Collections.emptyList(); } else if (property instanceof Collection) { return (Collection<String>)property; } else if (property instanceof String[]) { return Arrays.asList((String[])property); } else { return Collections.singleton(property.toString()); } } }
PropertyHelper { @SuppressWarnings("unchecked") public static Collection<String> getMultiValueProperty(Object property) { if (property == null) { return Collections.emptyList(); } else if (property instanceof Collection) { return (Collection<String>)property; } else if (property instanceof String[]) { return Arrays.asList((String[])property); } else { return Collections.singleton(property.toString()); } } private  PropertyHelper(); }
PropertyHelper { @SuppressWarnings("unchecked") public static Collection<String> getMultiValueProperty(Object property) { if (property == null) { return Collections.emptyList(); } else if (property instanceof Collection) { return (Collection<String>)property; } else if (property instanceof String[]) { return Arrays.asList((String[])property); } else { return Collections.singleton(property.toString()); } } private  PropertyHelper(); @SuppressWarnings("unchecked") static Collection<String> getMultiValueProperty(Object property); static String getProperty(Map<String, Object> dict, String name); static String getFirstNonEmptyStringProperty(Map<String, Object> dict, String... keys); }
PropertyHelper { @SuppressWarnings("unchecked") public static Collection<String> getMultiValueProperty(Object property) { if (property == null) { return Collections.emptyList(); } else if (property instanceof Collection) { return (Collection<String>)property; } else if (property instanceof String[]) { return Arrays.asList((String[])property); } else { return Collections.singleton(property.toString()); } } private  PropertyHelper(); @SuppressWarnings("unchecked") static Collection<String> getMultiValueProperty(Object property); static String getProperty(Map<String, Object> dict, String name); static String getFirstNonEmptyStringProperty(Map<String, Object> dict, String... keys); static final Logger LOG; }