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.Lazy<T>Wraps elements that should be load lazily to avoid issues when loading them using Dependency Injection libraries other than SPI.static classLang.MapBuilder<K,V>Convenient HashMap builder.static classLang.Result<T>
-
Constructor Summary
Constructors Modifier Constructor Description privateLang()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> io.vertx.core.Future<T>asFuture(io.vertx.core.Future<T> value)static <T> io.vertx.core.Future<T>asFuture(T value)static <T> Tawait(io.vertx.core.Future<T> future)This method has been place here for the sake of convenience.static <T> Class<T>classFor(String canonicalName)static <T,N>
List<N>convert(Iterable<T> data, Function<T,N> converter)static <T> List<T>filter(Collection<T> data, Function<T,Boolean> matcher)static <T> Lang.Result<T>first(Iterable<T> data)static <T> Lang.Result<T>first(Iterable<T> data, Function<T,Boolean> matcher)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, Function<T,Boolean> matcher)static List<String>nonEmptySetOfString(Iterable<String> values)static <T> Iterable<T>sorted(Iterable<T> data, Comparator<T> comparator)
-
-
-
Method Detail
-
instantiate
public static <T> T instantiate(String canonicalName)
-
instantiate
public static <T> T instantiate(Class<T> type)
-
first
public static <T> Lang.Result<T> first(Iterable<T> data)
-
first
public static <T> Lang.Result<T> first(Iterable<T> data, Function<T,Boolean> matcher)
-
filter
public static <T> List<T> filter(Collection<T> data, Function<T,Boolean> matcher)
-
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)
-
asFuture
public static <T> io.vertx.core.Future<T> asFuture(io.vertx.core.Future<T> value)
-
asFuture
public static <T> io.vertx.core.Future<T> asFuture(T value)
-
await
public static <T> T await(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.
-
-