Class 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 calling SerializeManager.add(InstanceFactory).
      abstract T instance()
      This should return an Instance of the desired class described by type().
      abstract java.lang.Class<T> type()
      Describes the Class type this Factory creates instances of.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InstanceFactory

        public InstanceFactory()
    • Method Detail

      • type

        public abstract java.lang.Class<T> type()
        Describes the Class type this Factory creates instances of. This will be used by the YAPIONDeserializer.
        Returns:
        the Class Type this Factory is for
      • instance

        public abstract T instance()
        This should return an Instance of the desired class described by type(). Each time this method is called it should return a completely new instance because the YAPIONDeserializer would destroy other instances otherwise.
        Returns:
        the Object instance of type type()