Class DefaultJsonSerializer

    • Method Detail

      • create

        public static DefaultJsonSerializer create​(CryptoManager cryptoManager)
        Creates an instance with optional encryption support.
        Parameters:
        cryptoManager - (nullable) The manager to use for activating the Encrypted annotation, or null to disable encryption support.
      • serialize

        public byte[] serialize​(Object input)
        Description copied from interface: JsonSerializer
        Serializes the given input into its encoded byte array form.
        Specified by:
        serialize in interface JsonSerializer
        Parameters:
        input - the object as input.
        Returns:
        the serialized output.
      • deserialize

        public <T> T deserialize​(Class<T> target,
                                 byte[] input)
        Description copied from interface: JsonSerializer
        Deserializes raw input into the target class.
        Specified by:
        deserialize in interface JsonSerializer
        Type Parameters:
        T - the generic type to deserialize into.
        Parameters:
        target - the target class.
        input - the raw input.
        Returns:
        the deserialized output.
      • deserialize

        public <T> T deserialize​(TypeRef<T> target,
                                 byte[] input)
        Description copied from interface: JsonSerializer
        Deserializes raw input into the target type.
        Specified by:
        deserialize in interface JsonSerializer
        Type Parameters:
        T - the type to deserialize into.
        Parameters:
        target - the target type.
        input - the raw input.
        Returns:
        the deserialized output.