public abstract class LevenshteinObjectMapper<T> extends java.lang.Object implements ObjectMapper<java.util.Map<java.lang.String,java.lang.Object>,T>
Modifier | Constructor and Description |
---|---|
protected |
LevenshteinObjectMapper()
Same as LevenshteinObjectMapper(Class<T>) but uses reflection to fetch the class from the generic.
|
protected |
LevenshteinObjectMapper(java.lang.Class<T> clazz)
Create an instance of LevenshteinObjectMapper and cache important data.
|
Modifier and Type | Method and Description |
---|---|
T |
dataToType(java.util.Map<java.lang.String,java.lang.Object> data)
Convert a map (String, Object) into an instance of T.
|
java.util.Map<java.lang.String,java.lang.Object> |
typeToData(T type)
Convert an instance of T to a map with KV String, Object, with K representing field names and V their respective values.
|
protected LevenshteinObjectMapper()
protected LevenshteinObjectMapper(java.lang.Class<T> clazz)
clazz
- Class data will be mapped to and frompublic final T dataToType(java.util.Map<java.lang.String,java.lang.Object> data)
dataToType
in interface ObjectMapper<java.util.Map<java.lang.String,java.lang.Object>,T>
data
- Map of field names (rough) and valuespublic final java.util.Map<java.lang.String,java.lang.Object> typeToData(T type)
typeToData
in interface ObjectMapper<java.util.Map<java.lang.String,java.lang.Object>,T>
type
- Value of type T