Package ch.njol.yggdrasil
Class SimpleClassSerializer<T>
java.lang.Object
ch.njol.yggdrasil.YggdrasilSerializer<T>
ch.njol.yggdrasil.SimpleClassSerializer<T>
- Type Parameters:
T- the type of the class to serialize
- All Implemented Interfaces:
ClassResolver
- Direct Known Subclasses:
SimpleClassSerializer.NonInstantiableClassSerializer
A simple serializer for a single class. Useful for registering serializers for external classes that should not
have their own classinfos, and that are not handled by
ConfigurationSerializer-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple serializer for classes that cannot be instantiated (e.g. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ch.njol.yggdrasil.YggdrasilSerializer
canBeInstantiated, deserialize, deserialize, newInstance, serialize
-
Field Details
-
type
-
id
-
-
Constructor Details
-
SimpleClassSerializer
-
-
Method Details
-
getClass
Description copied from interface:ClassResolverResolves a class by its ID.- Specified by:
getClassin interfaceClassResolver- Specified by:
getClassin classYggdrasilSerializer<T>- Parameters:
id- The ID used when storing objects- Returns:
- The Class object that represents data with the given ID, or null if the ID does not belong to the implementor
-
getID
Description copied from interface:ClassResolverGets an ID for a Class. The ID is used to identify the type of saved object.- Parameters:
clazz- The class to get the ID of- Returns:
- The ID of the given class, or null if this is not a class of the implementor
-