Class CoercionTuple<S,T>
- java.lang.Object
-
- org.apache.tapestry5.commons.services.CoercionTuple<S,T>
-
- Type Parameters:
S
- source (input) typeT
- target (output) type
public final class CoercionTuple<S,T> extends Object
An immutable object that represents a mapping from one type to another. This is also the contribution type when building theTypeCoercer
service. Wraps aCoercion
object that performs the work with additional properties that describe the input and output types of the coercion, needed when searching for an appropriate coercion (or sequence of coercions).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CoercionTuple.Key
Class that represents the key to be used to the mapped configuration of theTypeCoercer
service.
-
Constructor Summary
Constructors Constructor Description CoercionTuple(Class<S> sourceType, Class<T> targetType, Coercion<S,T> coercion)
Standard constructor, which defaults wrap to true.CoercionTuple(Class<S> sourceType, Class<T> targetType, Coercion<S,T> coercion, boolean wrap)
Internal-use constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <S,T>
CoercionTuple<S,T>create(Class<S> sourceType, Class<T> targetType, Coercion<S,T> coercion)
Convenience constructor to help with generics.Coercion<S,T>
getCoercion()
CoercionTuple.Key
getKey()
Class<S>
getSourceType()
Class<T>
getTargetType()
String
toString()
-
-
-
Constructor Detail
-
CoercionTuple
public CoercionTuple(Class<S> sourceType, Class<T> targetType, Coercion<S,T> coercion)
Standard constructor, which defaults wrap to true.
-
CoercionTuple
public CoercionTuple(Class<S> sourceType, Class<T> targetType, Coercion<S,T> coercion, boolean wrap)
Internal-use constructor.- Parameters:
sourceType
- the source (or input) type of the coercion, may be Void.class to indicate a coercion from nulltargetType
- the target (or output) type of the coercioncoercion
- the object that performs the coercionwrap
- if true, the coercion is wrapped to provide a useful toString()
-
-
Method Detail
-
create
public static <S,T> CoercionTuple<S,T> create(Class<S> sourceType, Class<T> targetType, Coercion<S,T> coercion)
Convenience constructor to help with generics.- Since:
- 5.2.0
-
getCoercion
public Coercion<S,T> getCoercion()
-
getSourceType
public Class<S> getSourceType()
-
getTargetType
public Class<T> getTargetType()
-
getKey
public CoercionTuple.Key getKey()
-
-