public final class Conversion extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Conversion.ConversionException |
static interface |
Conversion.Converter<V,T>
Converts a object of type V to a object of type T.
|
static class |
Conversion.UniqueId |
| Modifier and Type | Method and Description |
|---|---|
<T,V> Collection<T> |
convert(Collection<V> values,
Class<T> clazz) |
<T,V> Map<V,T> |
convert(Map<V,Object> values,
Class<T> clazz) |
<T> T |
convert(Object source,
Class<T> targetclass)
Convert a value to a specific class.
|
<T,V> Set<T> |
convert(Set<V> values,
Class<T> clazz) |
static Conversion |
get() |
static List<Class<?>> |
getParameterizedType(Class<?> ownerClass,
Class<?> genericSuperClass)
Returns the parameterized type of a class, if exists.
|
<T,V> void |
register(Conversion.Converter converter) |
public static Conversion get()
public <T> T convert(Object source, Class<T> targetclass)
source - value to convert.targetclass - class to convert to.public <T,V> Collection<T> convert(Collection<V> values, Class<T> clazz)
public <T,V> void register(Conversion.Converter converter)
public static List<Class<?>> getParameterizedType(Class<?> ownerClass, Class<?> genericSuperClass)
If a field is of type Set
If a field is of type Map
ownerClass - the implementing target class to check againstgenericSuperClass - the generic interface to resolve the type argument fromCopyright © 2013. All Rights Reserved.