@ConsumerType public interface Converter
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(java.lang.Object sourceObject,
ReifiedType targetType)
Return if this converter is able to convert the specified object to the
specified type.
|
java.lang.Object |
convert(java.lang.Object sourceObject,
ReifiedType targetType)
Convert the specified object to an instance of the specified type.
|
boolean canConvert(java.lang.Object sourceObject, ReifiedType targetType)
sourceObject
- The source object s
to convert.targetType
- The target type T
.true
if the conversion is possible, false
otherwise.java.lang.Object convert(java.lang.Object sourceObject, ReifiedType targetType) throws java.lang.Exception
sourceObject
- The source object s
to convert.targetType
- The target type T
.java.lang.Exception
- If the conversion cannot succeed. This exception should
not be thrown when the canConvert
method has returned true
.Copyright © OSGi Alliance (2000, 2018). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0