Class MapperAdapter<A,B>

java.lang.Object
com.helixframework.db.repository.MapperAdapter<A,B>
Type Parameters:
A - The source type to be converted.
B - The target type after conversion.
All Implemented Interfaces:
Mapper<A,B>

public abstract class MapperAdapter<A,B> extends Object implements Mapper<A,B>
This abstract class implements the Mapper interface to provide a base adapter for converting between two types, A and B. It implements default behavior that can be overridden by subclasses.
  • Constructor Details

    • MapperAdapter

      public MapperAdapter()
  • Method Details

    • to

      public B to(A a)
      Description copied from interface: Mapper
      Converts an object of type A to an object of type B.
      Specified by:
      to in interface Mapper<A,B>
      Parameters:
      a - the source object of type A to be converted
      Returns:
      the converted object of type B
    • to

      public B to(A a, Map<String,Object> ctx)
      Description copied from interface: Mapper
      Converts an object of type A to an object of type B using the provided context map.
      Specified by:
      to in interface Mapper<A,B>
      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

      public A from(B b)
      Description copied from interface: Mapper
      Converts an object of type B to an object of type A.
      Specified by:
      from in interface Mapper<A,B>
      Parameters:
      b - the source object of type B to be converted
      Returns:
      the converted object of type A
    • from

      public A from(B b, Map<String,Object> ctx)
      Description copied from interface: Mapper
      Converts an object of type B to an object of type A using the provided context map.
      Specified by:
      from in interface Mapper<A,B>
      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