public final class JsUtils
extends java.lang.Object
Constructor and Description |
---|
JsUtils() |
Modifier and Type | Method and Description |
---|---|
static <T,R> R[] |
asArray(io.vertx.core.json.JsonArray array,
java.lang.Class<R> klass,
java.util.function.Function<T,R> f)
T is the type of an element in the array
|
static <T,R> java.util.List<R> |
asList(io.vertx.core.json.JsonArray array,
java.util.function.Function<T,R> f)
T is the type of an element in the json array
|
static <E extends java.lang.Enum<E>> |
asSet(java.lang.Class<E> enumKlass,
io.vertx.core.json.JsonArray array)
Converts an array of enum-based strings to a set.
|
static java.util.Set<java.lang.String> |
asSet(io.vertx.core.json.JsonArray array)
Converts an array of strings to a set.
|
static <V> void |
forEach(io.vertx.core.json.JsonArray array,
java.util.function.BiConsumer<V,java.lang.Integer> toApply) |
static <V> void |
forEach(io.vertx.core.json.JsonArray array,
java.util.function.Consumer<V> toApply) |
static <K,V> java.util.Map<K,V> |
index(io.vertx.core.json.JsonArray array,
java.util.function.Function<V,K> keyForArrayValue) |
static <T,R> io.vertx.core.json.JsonArray |
toArray(java.util.Collection<T> items,
java.util.function.Function<T,R> toArrayItem) |
static io.vertx.core.json.JsonArray |
toArray(java.lang.String... strings) |
public static <E extends java.lang.Enum<E>> java.util.EnumSet<E> asSet(java.lang.Class<E> enumKlass, io.vertx.core.json.JsonArray array)
enumKlass
- array
- public static java.util.Set<java.lang.String> asSet(io.vertx.core.json.JsonArray array)
array
- public static <T,R> java.util.List<R> asList(io.vertx.core.json.JsonArray array, java.util.function.Function<T,R> f)
array
- f
- public static <T,R> R[] asArray(io.vertx.core.json.JsonArray array, java.lang.Class<R> klass, java.util.function.Function<T,R> f)
array
- f
- public static <K,V> java.util.Map<K,V> index(io.vertx.core.json.JsonArray array, java.util.function.Function<V,K> keyForArrayValue)
public static io.vertx.core.json.JsonArray toArray(java.lang.String... strings)
public static <T,R> io.vertx.core.json.JsonArray toArray(java.util.Collection<T> items, java.util.function.Function<T,R> toArrayItem)
public static <V> void forEach(io.vertx.core.json.JsonArray array, java.util.function.Consumer<V> toApply)
public static <V> void forEach(io.vertx.core.json.JsonArray array, java.util.function.BiConsumer<V,java.lang.Integer> toApply)
Copyright © 2021. All Rights Reserved.