Class ItemUtil

java.lang.Object
wtf.choco.alchema.util.ItemUtil

public final class ItemUtil
extends java.lang.Object
A series of utilities pertaining to ItemStacks.
Author:
Parker Hawke - Choco
  • Method Summary

    Modifier and Type Method Description
    static @NotNull org.bukkit.inventory.ItemStack deserializeItemStack​(@NotNull com.google.gson.JsonObject object)
    Deserialize an ItemStack from a JsonObject.
    static @NotNull com.google.gson.JsonObject serializeItemStack​(@NotNull org.bukkit.inventory.ItemStack item)
    Serialize an ItemStack to a JsonObject.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • serializeItemStack

      @NotNull public static @NotNull com.google.gson.JsonObject serializeItemStack​(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Serialize an ItemStack to a JsonObject.
      Parameters:
      item - the item to serialize
      Returns:
      the object into which the item was serialized
    • deserializeItemStack

      @NotNull public static @NotNull org.bukkit.inventory.ItemStack deserializeItemStack​(@NotNull @NotNull com.google.gson.JsonObject object)
      Deserialize an ItemStack from a JsonObject.
      Parameters:
      object - the object from which to deserialize an ItemStack
      Returns:
      the deserialized ItemStack