Class FieldSerialiser<R>

  • Type Parameters:
    R - function return type
    Direct Known Subclasses:
    FieldListAxisDescription

    public class FieldSerialiser<R>
    extends java.lang.Object
    default field serialiser implementation. The user needs to provide the reader and writer consumer lambdas to connect to the given serialiser back-end implementation.
    Author:
    rstein
    • Constructor Detail

      • FieldSerialiser

        public FieldSerialiser​(FieldSerialiser.TriConsumer reader,
                               FieldSerialiser.TriFunction<R> returnFunction,
                               FieldSerialiser.TriConsumer writer,
                               java.lang.Class<?> classPrototype,
                               java.lang.Class<?>... classGenericArguments)
        Parameters:
        reader - consumer executed when reading from the back-end serialiser implementation
        returnFunction - function that is being executed for returning a new object to the back-end serialiser implementation
        writer - consumer executed when writing to the back-end serialiser implementation
        classPrototype - applicable class/interface prototype reference for which the consumers are applicable (e.g. example 1: 'List.class' for List<String> or example 2: 'Map.class' for Map<Integer, String>)
        classGenericArguments - applicable generics definition (e.g. 'String.class' for List<String> or 'Integer.class, String.class' resp.)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getCanonicalName

        public java.lang.String getCanonicalName()
        Returns:
        canonical name of the class/interface description
      • getClassPrototype

        public java.lang.Class<?> getClassPrototype()
        Returns:
        class reference
      • getGenericsPrototypes

        public java.util.List<java.lang.reflect.Type> getGenericsPrototypes()
        Returns:
        class reference to generics arguments
      • getReaderFunction

        public FieldSerialiser.TriConsumer getReaderFunction()
        Returns:
        consumer that is being executed for reading from the back-end serialiser implementation
      • getSimpleName

        public java.lang.String getSimpleName()
        Returns:
        simple name name of the class/interface description
      • getWriterFunction

        public FieldSerialiser.TriConsumer getWriterFunction()
        Returns:
        consumer that is being executed for writing to the back-end serialiser implementation
      • getReturnObjectFunction

        public FieldSerialiser.TriFunction<R> getReturnObjectFunction()
        Returns:
        function that is being executed for returning a new object to the back-end serialiser implementation
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object