public interface Transformable
Using the as(Class) method, the object can be casted or transformed to fulfill the requested type.
| Modifier and Type | Method and Description |
|---|---|
<A> A |
as(Class<A> adapterType)
Adapts this into the given adapterType.
|
boolean |
is(Class<?> type)
Determines if this can be transformed to the given type.
|
<A> Optional<A> |
tryAs(Class<A> adapterType)
Tries to transform this into the given adapterType.
|
boolean is(@Nonnull Class<?> type)
type - the target type to check for<A> Optional<A> tryAs(@Nonnull Class<A> adapterType)
A - the type of the adapter typeadapterType - the target type to adapt to<A> A as(@Nonnull Class<A> adapterType)
A - the type of the adapter typeadapterType - the target type to adapt toIllegalArgumentException - if no transformation was possibleCopyright © 2018. All rights reserved.