@Test void testToListOther() { assertEquals(singletonList("0"), toList(0L)); }
public static List<String> toList(@Nullable @CheckForNull Object source) { List<String> stringList; if (source == null) { stringList = emptyList(); } else if (source instanceof Iterable<?>) { Iterable<?> iterable = (Iterable<?>) source; stringList = stream(iterable).map(DataConverter::toString).collect(Collectors.toList()); } else if (source instanceof String) { String string = (String) source; stringList = ListEscapeUtils.toList(string); } else { stringList = ListEscapeUtils.toList(source.toString()); } return stringList; }
DataConverter { public static List<String> toList(@Nullable @CheckForNull Object source) { List<String> stringList; if (source == null) { stringList = emptyList(); } else if (source instanceof Iterable<?>) { Iterable<?> iterable = (Iterable<?>) source; stringList = stream(iterable).map(DataConverter::toString).collect(Collectors.toList()); } else if (source instanceof String) { String string = (String) source; stringList = ListEscapeUtils.toList(string); } else { stringList = ListEscapeUtils.toList(source.toString()); } return stringList; } }
DataConverter { public static List<String> toList(@Nullable @CheckForNull Object source) { List<String> stringList; if (source == null) { stringList = emptyList(); } else if (source instanceof Iterable<?>) { Iterable<?> iterable = (Iterable<?>) source; stringList = stream(iterable).map(DataConverter::toString).collect(Collectors.toList()); } else if (source instanceof String) { String string = (String) source; stringList = ListEscapeUtils.toList(string); } else { stringList = ListEscapeUtils.toList(source.toString()); } return stringList; } private  DataConverter(); }
DataConverter { public static List<String> toList(@Nullable @CheckForNull Object source) { List<String> stringList; if (source == null) { stringList = emptyList(); } else if (source instanceof Iterable<?>) { Iterable<?> iterable = (Iterable<?>) source; stringList = stream(iterable).map(DataConverter::toString).collect(Collectors.toList()); } else if (source instanceof String) { String string = (String) source; stringList = ListEscapeUtils.toList(string); } else { stringList = ListEscapeUtils.toList(source.toString()); } return stringList; } private  DataConverter(); static Object convert(Object source, Attribute attr); @Nullable @CheckForNull static String toString(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static Integer toInt(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static Long toLong(@Nullable @CheckForNull Object source); @SuppressWarnings("java:S2447") // null is a valid return value @Nullable @CheckForNull static Boolean toBoolean(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static Double toDouble(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static LocalDate toLocalDate(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static Instant toInstant(@Nullable @CheckForNull Object source); static List<String> toList(@Nullable @CheckForNull Object source); static void setConversionService(ConversionService conversionService); }
DataConverter { public static List<String> toList(@Nullable @CheckForNull Object source) { List<String> stringList; if (source == null) { stringList = emptyList(); } else if (source instanceof Iterable<?>) { Iterable<?> iterable = (Iterable<?>) source; stringList = stream(iterable).map(DataConverter::toString).collect(Collectors.toList()); } else if (source instanceof String) { String string = (String) source; stringList = ListEscapeUtils.toList(string); } else { stringList = ListEscapeUtils.toList(source.toString()); } return stringList; } private  DataConverter(); static Object convert(Object source, Attribute attr); @Nullable @CheckForNull static String toString(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static Integer toInt(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static Long toLong(@Nullable @CheckForNull Object source); @SuppressWarnings("java:S2447") // null is a valid return value @Nullable @CheckForNull static Boolean toBoolean(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static Double toDouble(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static LocalDate toLocalDate(@Nullable @CheckForNull Object source); @Nullable @CheckForNull static Instant toInstant(@Nullable @CheckForNull Object source); static List<String> toList(@Nullable @CheckForNull Object source); static void setConversionService(ConversionService conversionService);  }