Class YAPIONSerializer


  • public final class YAPIONSerializer
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      YAPIONSerializer​(@NonNull java.lang.Object object, java.lang.String context)
      Creates a YAPIONSerializer for serializing an Object with a specified context.
      YAPIONSerializer​(@NonNull java.lang.Object object, java.lang.String context, boolean strict)
      Creates a YAPIONSerializer for serializing an Object with a specified context.
    • Method Summary

      Modifier and Type Method Description
      YAPIONObject getYAPIONObject()
      Get the internal parsed YAPIONObject.
      boolean isStrict()
      Returns whether the serialization should be strict and should not allow any data loss while serializing.
      YAPIONSerializer parse()
      Parses the Object to the YAPIONObject.
      YAPIONAnyType parse​(java.lang.Object object)  
      static YAPIONObject serialize​(@NonNull java.lang.Object object)
      Serialize an Object to an YAPION Object.
      static YAPIONObject serialize​(@NonNull java.lang.Object object, boolean strict)
      Serialize an Object to an YAPION Object.
      static YAPIONObject serialize​(@NonNull java.lang.Object object, java.lang.String context)
      Serialize an Object to an YAPION Object.
      static YAPIONObject serialize​(@NonNull java.lang.Object object, java.lang.String context, boolean strict)
      Serialize an Object to an YAPION Object.
      • Methods inherited from class java.lang.Object

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

      • YAPIONSerializer

        public YAPIONSerializer​(@NonNull
                                @NonNull java.lang.Object object,
                                java.lang.String context)
        Creates a YAPIONSerializer for serializing an Object with a specified context.
        Parameters:
        object - to serialize
        context - the context for serialization
      • YAPIONSerializer

        public YAPIONSerializer​(@NonNull
                                @NonNull java.lang.Object object,
                                java.lang.String context,
                                boolean strict)
        Creates a YAPIONSerializer for serializing an Object with a specified context.
        Parameters:
        object - to serialize
        context - the context for serialization
        strict - if serialization should be strict and check if any data would get lost while serialization
    • Method Detail

      • serialize

        public static YAPIONObject serialize​(@NonNull
                                             @NonNull java.lang.Object object)
        Serialize an Object to an YAPION Object.
        Parameters:
        object - to serialize
        Returns:
        YAPIONObject from the object to serialize
      • serialize

        public static YAPIONObject serialize​(@NonNull
                                             @NonNull java.lang.Object object,
                                             boolean strict)
        Serialize an Object to an YAPION Object.
        Parameters:
        object - to serialize
        strict - if serialization should be strict and check if any data would get lost while serialization
        Returns:
        YAPIONObject from the object to serialize
      • serialize

        public static YAPIONObject serialize​(@NonNull
                                             @NonNull java.lang.Object object,
                                             java.lang.String context)
        Serialize an Object to an YAPION Object.
        Parameters:
        object - to serialize
        context - the context for serialization
        Returns:
        YAPIONObject from the object to serialize
      • serialize

        public static YAPIONObject serialize​(@NonNull
                                             @NonNull java.lang.Object object,
                                             java.lang.String context,
                                             boolean strict)
        Serialize an Object to an YAPION Object.
        Parameters:
        object - to serialize
        context - the context for serialization
        strict - if serialization should be strict and check if any data would get lost while serialization
        Returns:
        YAPIONObject from the object to serialize
      • parse

        public YAPIONAnyType parse​(java.lang.Object object)
        Parameters:
        object - to parse
        Returns:
        the YAPIONAnyType of the Object inputted
      • isStrict

        public boolean isStrict()
        Returns whether the serialization should be strict and should not allow any data loss while serializing.
        Returns:
        true if data loss should be prohibited, false otherwise
      • parse

        public YAPIONSerializer parse()
        Parses the Object to the YAPIONObject.
      • getYAPIONObject

        public YAPIONObject getYAPIONObject()
        Get the internal parsed YAPIONObject.
        Returns:
        YAPIONObject from the object to serialize