Package yapion.serializing.api
Class InstanceFactory<T>
- java.lang.Object
-
- yapion.serializing.api.InstanceFactory<T>
-
public abstract class InstanceFactory<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description InstanceFactory()
-
Method Summary
Modifier and Type Method Description void
add()
Add this InstanceFactory to the SerializeManager by callingSerializeManager.add(InstanceFactory)
.abstract T
instance()
This should return an Instance of the desired class described bytype()
.abstract java.lang.Class<T>
type()
Describes the Class type this Factory creates instances of.
-
-
-
Method Detail
-
type
public abstract java.lang.Class<T> type()
Describes the Class type this Factory creates instances of. This will be used by theYAPIONDeserializer
.- Returns:
- the Class Type this Factory is for
-
instance
public abstract T instance()
This should return an Instance of the desired class described bytype()
. Each time this method is called it should return a completely new instance because theYAPIONDeserializer
would destroy other instances otherwise.- Returns:
- the Object instance of type
type()
-
add
public final void add()
Add this InstanceFactory to the SerializeManager by callingSerializeManager.add(InstanceFactory)
.
-
-