Package kos.core

Class Lang

java.lang.Object
kos.core.Lang

public final class Lang extends Object
Utility methods internally used by Kos. We do not encourage you to rely on them as they may be discontinued without any notice.
  • Constructor Details

    • Lang

      private Lang()
  • Method Details

    • instantiate

      public static <T> T instantiate(String canonicalName)
    • classFor

      public static <T> Class<T> classFor(String canonicalName)
    • instantiate

      public static <T> T instantiate(Class<T> type)
    • firstNotNull

      public static <T> T firstNotNull(T... args)
    • first

      public static <T> ImplementationLoader.Result<T> first(Iterable<T> data)
    • matches

      public static <T> boolean matches(Iterable<T> data, Predicate<T> matcher)
    • first

      public static <T> ImplementationLoader.Result<T> first(Iterable<T> data, Predicate<T> matcher)
    • filter

      public static <T> List<T> filter(Collection<T> data, Predicate<T> matcher)
    • convert

      public static <T, N> List<N> convert(Iterable<T> data, Function<T,N> converter)
    • convertIndex

      public static <T, N> List<N> convertIndex(Iterable<T> data, BiFunction<Integer,T,N> converter)
    • mapOf

      public static <K, V> Lang.MapBuilder<K,V> mapOf(K key, V value)
    • nonEmptySetOfString

      public static List<String> nonEmptySetOfString(Iterable<String> values)
    • sorted

      public static <T> Iterable<T> sorted(Iterable<T> data, Comparator<T> comparator)
    • waitFor

      public static <T> T waitFor(io.vertx.core.Future<T> future)
      This method has been place here for the sake of convenience. It should avoided by developers as it is quite dangerous and might introduce slowness into the system.
    • waitFor

      public static <T> T waitFor(AtomicReference<T> reference)