Interface TypeCoercerProxy
-
- All Known Implementing Classes:
TypeCoercerProxyImpl
public interface TypeCoercerProxy
A simplified version ofTypeCoercer
used to defer the instantiation of the actual TypeCoercer service until necessary.- Since:
- 5.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <S,T>
Tcoerce(S input, Class<T> targetType)
Returns input cast to targetType if input is an instance of target type, otherwise delegates toTypeCoercer.coerce(Object, Class)
.
-
-
-
Method Detail
-
coerce
<S,T> T coerce(S input, Class<T> targetType)
Returns input cast to targetType if input is an instance of target type, otherwise delegates toTypeCoercer.coerce(Object, Class)
.- Type Parameters:
S
-T
-- Parameters:
input
- value to be coercedtargetType
- desired type of value- Returns:
- the value, coerced
- Throws:
RuntimeException
- if the input can not be coerced
-
-