Class Utils


  • public class Utils
    extends Object
    A collection of utility methods
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • isEmpty

        public static boolean isEmpty​(String string)
      • isNotEmpty

        public static boolean isNotEmpty​(String string)
      • coalesce

        public static String coalesce​(String... values)
      • capitalize

        public static String capitalize​(String str)
      • isEmpty

        public static <T> boolean isEmpty​(T[] array)
      • isNotEmpty

        public static <T> boolean isNotEmpty​(T[] array)
      • requireNonEmpty

        public static <T> T[] requireNonEmpty​(T[] array)
      • indexOf

        public static int indexOf​(String[] strings,
                                  String element,
                                  int missingIndex)
      • isEmpty

        public static <C extends Collection<T>,​T> boolean isEmpty​(C collection)
      • isNotEmpty

        public static <C extends Collection<T>,​T> boolean isNotEmpty​(C collection)
      • defaultIfEmpty

        public static <C extends Collection<T>,​T> C defaultIfEmpty​(C collection,
                                                                         C fallback)
      • extractInstances

        public static <T> Stream<T> extractInstances​(Collection<? super T> collection,
                                                     Class<T> clazz)
      • emptyArray

        public static String[] emptyArray()
      • emptyIfNull

        public static String[] emptyIfNull​(String[] array)
      • requireNonEmpty

        public static String requireNonEmpty​(String value)
      • singletonList

        public static <T> List<T> singletonList​(T element)
      • asList

        public static <T> List<T> asList​(T[] elements)
      • acceptAll

        public static <T> Predicate<T> acceptAll()
      • put

        public static <K,​V> Map<K,​V> put​(Map<K,​V> map,
                                                     K k,
                                                     V v)