Class Util

java.lang.Object
net.covers1624.coffeegrinder.util.Util

public class Util extends Object
Created by covers1624 on 23/2/21.
  • Constructor Details

    • Util

      public Util()
  • Method Details

    • reverse

      public static <T> void reverse(List<T> list)
    • safeConcat

      public static <T> Iterable<T> safeConcat(@Nullable @Nullable List<T> a, @Nullable @Nullable List<T> b)
    • singleMemoize

      public static <T> Supplier<T> singleMemoize(Supplier<T> supplier)
    • indexOf

      public static <T> int indexOf(Iterable<? extends T> things, Predicate<? super T> pred)
    • toList

      public static <E> ArrayList<E> toList(Iterable<? extends E> itr)
    • formatDuration

      public static String formatDuration(long elapsedTimeInNs)
    • closeResources

      public static void closeResources(@Nullable @Nullable Closeable... resources) throws IOException
      Throws:
      IOException
    • closeResources

      @SafeVarargs public static void closeResources(Iterable<? extends @Nullable Closeable>... iterables) throws IOException
      Throws:
      IOException
    • closeSafe

      public static void closeSafe(@Nullable @Nullable Closeable... resources)
    • closeSafe

      @SafeVarargs public static void closeSafe(Iterable<? extends @Nullable Closeable>... iterables)
    • addSorted

      public static <T, L extends List<T> & RandomAccess> void addSorted(L list, T thing, Comparator<? super T> comparator)