Interface Mapper<A,B>

Type Parameters:
A - The source type to be converted.
B - The target type after conversion.
All Known Implementing Classes:
MapperAdapter

public interface Mapper<A,B>
This interface defines a Mapper that can be used to convert between two types, A and B. It provides methods to map an object of type A to an object of type B and vice versa. The methods can optionally use a context map to assist in the mapping process.
  • Method Summary

    Modifier and Type
    Method
    Description
    from(B b)
    Converts an object of type B to an object of type A.
    from(B b, Map<String,Object> ctx)
    Converts an object of type B to an object of type A using the provided context map.
    to(A a)
    Converts an object of type A to an object of type B.
    to(A a, Map<String,Object> ctx)
    Converts an object of type A to an object of type B using the provided context map.
  • Method Details

    • to

      B to(A a)
      Converts an object of type A to an object of type B.
      Parameters:
      a - the source object of type A to be converted
      Returns:
      the converted object of type B
    • to

      B to(A a, Map<String,Object> ctx)
      Converts an object of type A to an object of type B using the provided context map.
      Parameters:
      a - the source object of type A to be converted
      ctx - a map containing additional context information for the conversion
      Returns:
      the converted object of type B
    • from

      A from(B b)
      Converts an object of type B to an object of type A.
      Parameters:
      b - the source object of type B to be converted
      Returns:
      the converted object of type A
    • from

      A from(B b, Map<String,Object> ctx)
      Converts an object of type B to an object of type A using the provided context map.
      Parameters:
      b - the source object of type B to be converted
      ctx - a map containing additional context information for the conversion
      Returns:
      the converted object of type A