public interface ArgumentConverter
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(Object argument)
Checks whether the given argument can be converted by this
ArgumentConverter. |
Object |
convert(Object argument)
Converts the given argument if
canConvert(Object) returned true. |
boolean canConvert(Object argument)
ArgumentConverter. If true is returned
from this method, the result returned by convert(Object) is guaranteed to "make sense". Otherwise,
the result is not defined an any Exception may be thrown.argument - the argument for which a possible conversion is checkedconvert(Object)Object convert(Object argument)
canConvert(Object) returned true. Otherwise the behaviour is
intentionally undefined but is it better to throw an Exception, since returning a nonsensical could
make debugging more complex for a user.argument - the argument which should be convertedCopyright © 2019. All rights reserved.