public static interface DTOs.Converter
| Modifier and Type | Method and Description |
|---|---|
<T> T |
to(java.lang.Class<T> dest)
Convert an object source to the type given in dest.
|
java.lang.Object |
to(java.lang.reflect.Type dest)
Convert an object to the given type.
|
<T> T |
to(TypeReference<T> dest)
Convert an object to the given type reference.
|
<T> T to(java.lang.Class<T> dest) throws java.lang.Exception
The conversion uses the type information and any generic information
to do a proper conversion. I.e. a List<Integer> can be
converted to a String[] and vice versa. It also recognizes
DTOs and allows them to be converted to maps and vice versa.
Maps can also be converted to interfaces, the names of the methods
then act as keys in the map. Same conventions for name mangling are
used as the DS configuration properties
dest - The destination type.java.lang.Exception<T> T to(TypeReference<T> dest) throws java.lang.Exception
dest - the destination type specificationnull if no conversion could
be found.java.lang.Exceptionjava.lang.Object to(java.lang.reflect.Type dest)
throws java.lang.Exception
dest - the destination typejava.lang.ExceptionCopyright (c) OSGi Alliance (2014, 2020). All Rights Reserved.