Class ItemStackSerializer

java.lang.Object
dev.crafty.core.config.serializer.builtin.ItemStackSerializer
All Implemented Interfaces:
ConfigSerializer<org.bukkit.inventory.ItemStack>

public class ItemStackSerializer extends Object implements ConfigSerializer<org.bukkit.inventory.ItemStack>
Serializer for ItemStack objects. This serializer handles converting ItemStack objects to and from configuration sections.
Since:
1.0.0
  • Constructor Details

    • ItemStackSerializer

      public ItemStackSerializer()
  • Method Details

    • serialize

      public void serialize(ConfigSerializer.SerializationArgs<org.bukkit.inventory.ItemStack> args)
      Description copied from interface: ConfigSerializer
      Serialize an object to a configuration section.
      Specified by:
      serialize in interface ConfigSerializer<org.bukkit.inventory.ItemStack>
      Parameters:
      args - The serialization arguments
    • deserialize

      public Optional<org.bukkit.inventory.ItemStack> deserialize(SectionWrapper sectionWrapper, String path)
      Description copied from interface: ConfigSerializer
      Deserialize an object from a configuration section.
      Specified by:
      deserialize in interface ConfigSerializer<org.bukkit.inventory.ItemStack>
      Parameters:
      sectionWrapper - The configuration section to deserialize from
      path - The path within the section to deserialize from
      Returns:
      The deserialized object
    • getType

      public Class<org.bukkit.inventory.ItemStack> getType()
      Description copied from interface: ConfigSerializer
      Get the type of object this serializer handles.
      Specified by:
      getType in interface ConfigSerializer<org.bukkit.inventory.ItemStack>
      Returns:
      The class of the object type