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
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.crafty.core.config.serializer.ConfigSerializer
ConfigSerializer.SerializationArgs<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional
<org.bukkit.inventory.ItemStack> deserialize
(SectionWrapper sectionWrapper, String path) Deserialize an object from a configuration section.Class
<org.bukkit.inventory.ItemStack> getType()
Get the type of object this serializer handles.void
serialize
(ConfigSerializer.SerializationArgs<org.bukkit.inventory.ItemStack> args) Serialize an object to a configuration section.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.crafty.core.config.serializer.ConfigSerializer
getSerializer, save
-
Constructor Details
-
ItemStackSerializer
public ItemStackSerializer()
-
-
Method Details
-
serialize
Description copied from interface:ConfigSerializer
Serialize an object to a configuration section.- Specified by:
serialize
in interfaceConfigSerializer<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 interfaceConfigSerializer<org.bukkit.inventory.ItemStack>
- Parameters:
sectionWrapper
- The configuration section to deserialize frompath
- The path within the section to deserialize from- Returns:
- The deserialized object
-
getType
Description copied from interface:ConfigSerializer
Get the type of object this serializer handles.- Specified by:
getType
in interfaceConfigSerializer<org.bukkit.inventory.ItemStack>
- Returns:
- The class of the object type
-