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) type
    `T` - target (output) type

      public final class CoercionTuple<S,T>
      extends java.lang.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).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CoercionTuple(java.lang.Class<S> sourceType, java.lang.Class<T> targetType, Coercion<S,T> coercion)` Standard constructor, which defaults wrap to true.
    `CoercionTuple(java.lang.Class<S> sourceType, java.lang.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 and Description
    --- | ---
    `static <S,T> CoercionTuple<S,T>` | `create(java.lang.Class<S> sourceType, java.lang.Class<T> targetType, Coercion<S,T> coercion)` Convenience constructor to help with generics.
    `Coercion<S,T>` | `getCoercion()`
    `java.lang.Class<S>` | `getSourceType()`
    `java.lang.Class<T>` | `getTargetType()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CoercionTuple

          public CoercionTuple(java.lang.Class<S> sourceType,
                               java.lang.Class<T> targetType,
                               Coercion<S,T> coercion)

      Standard constructor, which defaults wrap to true.

    - #### CoercionTuple

          public CoercionTuple(java.lang.Class<S> sourceType,
                               java.lang.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 null
        `targetType` - the target (or output) type of the coercion
        `coercion` - the object that performs the coercion
        `wrap` - if true, the coercion is wrapped to provide a useful toString()

  - ### Method Detail

    - #### create

          public static <S,T> CoercionTuple<S,T> create(java.lang.Class<S> sourceType,
                                                        java.lang.Class<T> targetType,
                                                        Coercion<S,T> coercion)

      Convenience constructor to help with generics.
      Since:
        5.2.0

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getCoercion

          public Coercion<S,T> getCoercion()

    - #### getSourceType

          public java.lang.Class<S> getSourceType()

    - #### getTargetType

          public java.lang.Class<T> getTargetType()

${project.version} - Copyright © 2003-2015 The Apache Software Foundation.