public interface Converter
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(Object sourceObject,
ReifiedType targetType)
Return if this converter is able to convert the specified object to the
specified type.
|
Object |
convert(Object sourceObject,
ReifiedType targetType)
Convert the specified object to an instance of the specified type.
|
boolean canConvert(Object sourceObject, ReifiedType targetType)
sourceObject
- The source object s
to convert.targetType
- The target type T
.true
if the conversion is possible,
false
otherwise.Object convert(Object sourceObject, ReifiedType targetType) throws Exception
sourceObject
- The source object s
to convert.targetType
- The target type T
.Exception
- If the conversion cannot succeed. This exception should
not be thrown when the canConvert
method has
returned true
.Copyright © 2018 JBoss by Red Hat. All rights reserved.