Package co.aikar.util
Class JSONUtil
java.lang.Object
co.aikar.util.JSONUtil
Deprecated, for removal: This API element is subject to removal in a future version.
Provides Utility methods that assist with generating JSON Objects
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Deprecated, for removal: This API element is subject to removal in a future version.Simply stores a key and a value, used internally by many methods below. -
Method Summary
Modifier and TypeMethodDescriptionappendObjectData
(@NotNull Map parent, @NotNull JSONUtil.JSONPair... data) Deprecated, for removal: This API element is subject to removal in a future version.This appends multiple key/value Obj pairs into a JSON ObjectcreateObject
(@NotNull JSONUtil.JSONPair... data) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new JSON object from multiple JSONPair key/value pairsstatic @NotNull JSONUtil.JSONPair
Deprecated, for removal: This API element is subject to removal in a future version.static @NotNull JSONUtil.JSONPair
Deprecated, for removal: This API element is subject to removal in a future version.Creates a key/value "JSONPair" objectDeprecated, for removal: This API element is subject to removal in a future version.This builds a JSON array from a set of datatoArrayMapper
(E[] collection, @NotNull Function<E, Object> mapper) Deprecated, for removal: This API element is subject to removal in a future version.These help build a single JSON array using a mapper functionDeprecated, for removal: This API element is subject to removal in a future version.toObjectMapper
(E[] collection, @NotNull Function<E, JSONUtil.JSONPair> mapper) Deprecated, for removal: This API element is subject to removal in a future version.These help build a single JSON Object from a collection, using a mapper functiontoObjectMapper
(@NotNull Iterable<E> collection, @NotNull Function<E, JSONUtil.JSONPair> mapper) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
pair
@NotNull public static @NotNull JSONUtil.JSONPair pair(@NotNull @NotNull String key, @Nullable @Nullable Object obj) Deprecated, for removal: This API element is subject to removal in a future version.Creates a key/value "JSONPair" object- Parameters:
key
- Key to useobj
- Value to use- Returns:
- JSONPair
-
pair
Deprecated, for removal: This API element is subject to removal in a future version. -
createObject
@NotNull public static @NotNull Map<String,Object> createObject(@NotNull @NotNull JSONUtil.JSONPair... data) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new JSON object from multiple JSONPair key/value pairs- Parameters:
data
- JSONPairs- Returns:
- Map
-
appendObjectData
@NotNull public static @NotNull Map<String,Object> appendObjectData(@NotNull @NotNull Map parent, @NotNull @NotNull JSONUtil.JSONPair... data) Deprecated, for removal: This API element is subject to removal in a future version.This appends multiple key/value Obj pairs into a JSON Object- Parameters:
parent
- Map to be appended todata
- Data to append- Returns:
- Map
-
toArray
Deprecated, for removal: This API element is subject to removal in a future version.This builds a JSON array from a set of data- Parameters:
data
- Data to build JSON array from- Returns:
- List
-
toArrayMapper
@NotNull public static <E> @NotNull List toArrayMapper(@NotNull E[] collection, @NotNull @NotNull Function<E, Object> mapper) Deprecated, for removal: This API element is subject to removal in a future version.These help build a single JSON array using a mapper function- Type Parameters:
E
- Element Type- Parameters:
collection
- Collection to apply tomapper
- Mapper to apply- Returns:
- List
-
toArrayMapper
@NotNull public static <E> @NotNull List toArrayMapper(@NotNull @NotNull Iterable<E> collection, @NotNull @NotNull Function<E, Object> mapper) Deprecated, for removal: This API element is subject to removal in a future version. -
toObjectMapper
@NotNull public static <E> @NotNull Map toObjectMapper(@NotNull E[] collection, @NotNull @NotNull Function<E, JSONUtil.JSONPair> mapper) Deprecated, for removal: This API element is subject to removal in a future version.These help build a single JSON Object from a collection, using a mapper function- Type Parameters:
E
- Element Type- Parameters:
collection
- Collection to apply tomapper
- Mapper to apply- Returns:
- Map
-
toObjectMapper
@NotNull public static <E> @NotNull Map toObjectMapper(@NotNull @NotNull Iterable<E> collection, @NotNull @NotNull Function<E, JSONUtil.JSONPair> mapper) Deprecated, for removal: This API element is subject to removal in a future version.
-