Interface MarshalTypeFactory<T,SRC>

  • Type Parameters:
    T - The type of the data structure from which a marshaled (external) representation is to be unmarshaled.
    SRC - The type of the marshaled (external) representation.
    All Known Subinterfaces:
    MarshalTypeFactory.MarshalTypeFactoryComposite<T,SRC,C>
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.


    @FunctionalInterface
    public interface MarshalTypeFactory<T,SRC>
    The MarshalTypeFactory defines the functionality which must be provided in order to create marshaling functionality from an internal representation of a given data structure to an external representation such as a String or an InputStream.
    • Method Detail

      • toMarshaled

        SRC toMarshaled​(T aDataStructure)
                 throws org.refcodes.exception.MarshalException
        This method creates / retrieves (converts to) from the provided data structure to its external representation.
        Parameters:
        aDataStructure - The data structure to be marshaled.
        Returns:
        The according marshaled data structure from the external representation.
        Throws:
        org.refcodes.exception.MarshalException - Thrown when marshaling / serializing a data structure fails.
      • toMarshaled

        default SRC toMarshaled​(T aDataStructure,
                                java.util.Map<java.lang.String,java.lang.String> aProperties)
                         throws org.refcodes.exception.MarshalException
        This method creates / retrieves (converts to) an instance from the provided external representation.
        Parameters:
        aDataStructure - The data structure to be marshaled.
        aProperties - The dynamic properties which are used to configure the desired result.
        Returns:
        The according marshaled data structure from the external representation.
        Throws:
        org.refcodes.exception.MarshalException - Thrown when marshaling / serializing a data structure fails.