| Constructor and Description |
|---|
CastFunction(Class<T> type)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
apply(Object obj) |
protected RuntimeException |
handleFailure(Object obj,
ClassCastException e)
Generate an exception to throw when a cast failure occurs.
|
public CastFunction(Class<T> type)
type - desired typeIllegalArgumentException - if type is nullprotected RuntimeException handleFailure(Object obj, ClassCastException e)
The implementation in CastFunction just throws e.
obj - object on which cast failede - resulting exceptionCopyright © 2016. All rights reserved.