Interface ConfigSerializer<T>
- Type Parameters:
T
- The type this serializer handles
- All Known Implementing Classes:
ItemStackSerializer
,LocationSerializer
Simple interface for creating custom configuration serializers.
Serializers work directly with MemoryConfiguration for easy .set() operations.
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(SectionWrapper from) Deserialize an object from a SectionWrapper.default T
deserialize
(Map<String, Object> stringObjectMap) Get the class that this serializer handles.void
Serialize an object to a MemoryConfiguration.
-
Method Details
-
getTargetClass
Get the class that this serializer handles.- Returns:
- The target class
-
serialize
Serialize an object to a MemoryConfiguration. Simply call config.set(key, value) for each field you want to serialize.- Parameters:
toSerialize
- The object to serializeconfig
- The blank MemoryConfiguration to write to
-
deserialize
Deserialize an object from a SectionWrapper.- Parameters:
from
- The SectionWrapper containing the serialized data- Returns:
- The deserialized object
-
deserialize
-
serialize
-