Package com.helixframework.db.repository
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 TypeMethodDescriptionConverts an object of type B to an object of type A.Converts an object of type B to an object of type A using the provided context map.Converts an object of type A to an object of type B.Converts an object of type A to an object of type B using the provided context map.
-
Method Details
-
to
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
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 convertedctx- a map containing additional context information for the conversion- Returns:
- the converted object of type B
-
from
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
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 convertedctx- a map containing additional context information for the conversion- Returns:
- the converted object of type A
-