Package aQute.lib.converter
Class Converter
java.lang.Object
aQute.lib.converter.Converter
General Java type converter from an object to any type. Supports number
conversion
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
cnv
(TypeReference<T> tr, Object source) static <T> T
static Object
<T> T
convert
(TypeReference<T> type, Object o) <T> T
hook
(Type type, Converter.Hook hook) static boolean
isMultiple
(Class<?> c) Return if the class's instances can hold multiple values.static boolean
isMultiple
(Type c) Return if the class's instances can hold multiple values.static String
<T> T
Convert a map to an interface.void
void
setFatalIsException
(boolean b) Collection
<?> Map
<?, ?>
-
Constructor Details
-
Converter
public Converter()
-
-
Method Details
-
convert
- Throws:
Exception
-
convert
- Throws:
Exception
-
convert
- Throws:
Exception
-
array
- Throws:
Exception
-
toCollection
-
toMap
- Throws:
Exception
-
setFatalIsException
public void setFatalIsException(boolean b) -
hook
-
proxy
Convert a map to an interface.- Parameters:
interfc
-properties
-- Returns:
- proxy object for map
-
mangleMethodName
-
cnv
- Throws:
Exception
-
cnv
- Throws:
Exception
-
cnv
- Throws:
Exception
-
isMultiple
Return if the class's instances can hold multiple values.- Parameters:
c
- the class to test- Returns:
- true if the class's instances can hold multiple values
-
isMultiple
Return if the class's instances can hold multiple values.- Parameters:
c
- the class to test- Returns:
- true if the class's instances can hold multiple values
-
setBase
-