Package co.aikar.util

Class JSONUtil

java.lang.Object
co.aikar.util.JSONUtil

@Deprecated(forRemoval=true) public final class JSONUtil extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Provides Utility methods that assist with generating JSON Objects
  • Method Details

    • pair

      @NotNull public static JSONUtil.JSONPair pair(@NotNull String key, @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 use
      obj - Value to use
      Returns:
      JSONPair
    • pair

      @NotNull public static JSONUtil.JSONPair pair(long key, @Nullable Object obj)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • createObject

      @NotNull public static Map<String,Object> createObject(@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 Map<String,Object> appendObjectData(@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 Object
      Parameters:
      parent - Map to be appended to
      data - Data to append
      Returns:
      Map
    • toArray

      @NotNull public static List toArray(@NotNull Object... data)
      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> List toArrayMapper(@NotNull 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 function
      Type Parameters:
      E - Element Type
      Parameters:
      collection - Collection to apply to
      mapper - Mapper to apply
      Returns:
      List
    • toArrayMapper

      @NotNull public static <E> List toArrayMapper(@NotNull Iterable<E> collection, @NotNull Function<E,Object> mapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toObjectMapper

      @NotNull public static <E> Map toObjectMapper(@NotNull 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 function
      Type Parameters:
      E - Element Type
      Parameters:
      collection - Collection to apply to
      mapper - Mapper to apply
      Returns:
      Map
    • toObjectMapper

      @NotNull public static <E> Map toObjectMapper(@NotNull Iterable<E> collection, @NotNull Function<E,JSONUtil.JSONPair> mapper)
      Deprecated, for removal: This API element is subject to removal in a future version.