org.apache.tapestry5.ioc.services
Class CoercionTuple<S,T>
java.lang.Object
org.apache.tapestry5.ioc.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 the TypeCoercer service. Wraps a Coercion 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).
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 coerciontargetType - 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()
toString
public String toString()
- Overrides:
toString in class Object
getCoercion
public Coercion<S,T> getCoercion()
getSourceType
public Class<S> getSourceType()
getTargetType
public Class<T> getTargetType()
Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.