Class ReversedAdapter<A,​B>

  • All Implemented Interfaces:
    Adapter<A,​B>, MapperConverter

    public class ReversedAdapter<A,​B>
    extends java.lang.Object
    implements Adapter<A,​B>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Adapter<B,​A> delegate  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      B from​(A a)
      Take the POJO_TYPE object A from a POJO an convert it to JSON_TYPE which will be inserted into the JSON output.
      A to​(B b)
      Transfer JSONTYPE_TYPE from JSON to POJO as POJO_TYPE.
      • Methods inherited from class java.lang.Object

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

      • delegate

        private final Adapter<B,​A> delegate
    • Constructor Detail

      • ReversedAdapter

        public ReversedAdapter​(Adapter<B,​A> delegate)
    • Method Detail

      • to

        public A to​(B b)
        Description copied from interface: Adapter
        Transfer JSONTYPE_TYPE from JSON to POJO as POJO_TYPE.
        Specified by:
        to in interface Adapter<A,​B>
        Parameters:
        b - the JSON type
        Returns:
        the equivalent Java type
      • from

        public B from​(A a)
        Description copied from interface: Adapter
        Take the POJO_TYPE object A from a POJO an convert it to JSON_TYPE which will be inserted into the JSON output.
        Specified by:
        from in interface Adapter<A,​B>
        Parameters:
        a - the Java type
        Returns:
        the equivalent JSON type