Interface Mapping<A,B>
-
- Type Parameters:
A
- Class to map fromB
- Class to map to
public interface Mapping<A,B>
Interface to allow mapping from one class to another class. For example, this could be used to map from a name to the upper case version of that name, or to the search case version of that name.
-
-
Field Summary
Fields Modifier and Type Field Description static Mapping<Object,Object>
IDENTITY
Map from the object to itself.static Mapping<String,String>
TO_SEARCH_CASE
Map from a string to the search case version of that string.static Mapping<String,String>
TO_US_LOWERCASE
Map from a string to the lower case version of the string, in the US locale.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> Mapping<T,T>
getIdentity()
Map from the object to itself.B
map(A original)
Perform a mapping from the original value to a new value.
-
-
-
Field Detail
-
TO_US_LOWERCASE
static final Mapping<String,String> TO_US_LOWERCASE
Map from a string to the lower case version of the string, in the US locale. Note If you want to look for the search name stored in the database, you should useTO_SEARCH_CASE
instead.
-
-
Method Detail
-
getIdentity
static <T> Mapping<T,T> getIdentity()
Map from the object to itself.- Returns:
- an identity mapping function
-
-