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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLang.MapBuilder<K,V>Convenient HashMap builder.
-
Constructor Summary
Constructors Modifier Constructor Description privateLang()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Class<T>classFor(String canonicalName)static <T,N>
List<N>convert(Iterable<T> data, Function<T,N> converter)static <T,N>
List<N>convertIndex(Iterable<T> data, BiFunction<Integer,T,N> converter)static <T> List<T>filter(Collection<T> data, Predicate<T> matcher)static <T> ImplementationLoader.Result<T>first(Iterable<T> data)static <T> ImplementationLoader.Result<T>first(Iterable<T> data, Predicate<T> matcher)static <T> TfirstNotNull(T... args)static <T> Tinstantiate(Class<T> type)static <T> Tinstantiate(String canonicalName)static <K,V>
Lang.MapBuilder<K,V>mapOf(K key, V value)static <T> booleanmatches(Iterable<T> data, Predicate<T> matcher)static List<String>nonEmptySetOfString(Iterable<String> values)static <T> Iterable<T>sorted(Iterable<T> data, Comparator<T> comparator)static <T> TwaitFor(io.vertx.core.Future<T> future)This method has been place here for the sake of convenience.static <T> TwaitFor(AtomicReference<T> reference)
-
-
-
Method Detail
-
instantiate
public static <T> T instantiate(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)
-
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)
-
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)
-
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)
-
-