Interface SerializerObjectInterface<T>

  • All Known Implementing Classes:
    SerializerObject

    public interface SerializerObjectInterface<T>
    • Method Detail

      • type

        java.lang.Class<T> type()
        Describes the Class type this Serializer should be used for by the YAPIONSerializer and YAPIONDeserializer this Serializer will be used preferably as it should suite the Class better than the internal fallback.
        Returns:
        the Class Type this Serializer is for
      • isInterface

        default boolean isInterface()
        Returns true if type() should be treated as an interface. YAPIONSerializer and YAPIONDeserializer will treat this return type as secondary choice if a more specific serializer is missing.
        Returns:
        true if type() should be treated as an interface, false otherwise
      • serialize

        YAPIONObject serialize​(SerializeData<T> serializeData)
        This method is used to serialize the type defined by type(). You will get the object to serialize as well as the current YAPIONSerializer designated to this serialization. This serializer should be used to serialize any parts of the Object that are not primitive types. So anything that cannot be represented by YAPIONValue. To use the serializer call YAPIONSerializer.parse(Object). You will need to provide the Object and the YAPIONSerializer will provide you with an YAPIONAnyType. This is generic and can be an YAPIONObject, YAPIONMap, YAPIONArray, YAPIONPointer or YAPIONValue. So you should be able to handle any thing you can get or just handle it generically with YAPIONAnyType to be safe.
        Parameters:
        serializeData - all data for serialization
        Returns:
        the serialized version of the inputted Object
      • deserialize

        T deserialize​(DeserializeData<YAPIONObject> deserializeData)
        This method is used to deserialize the type defined by type(). You will get the specified YAPIONObject as well as the current YAPIONDeserializer designed to this deserialization. This deserializer should be used to deserialize any parts of the YAPIONObject that are not YAPIONValue types. So anything that cannot be represented by YAPIONValue. To use the serializer call YAPIONDeserializer.parse(YAPIONAnyType). You will need to provide the YAPIONAnyType and the YAPIONDeserializer will provide you with an Object. This is generic and can be any Object. So you should be able to handle any thing generically.
        Parameters:
        deserializeData - all data for deserialization
        Returns:
        the deserialized version of the inputted YAPIONObject