org.modeshape.jcr.query

## Class Tuples.Tuple2TypeFactory<T1,T2>

- java.lang.Object
- - org.modeshape.jcr.query.Tuples.Tuple2TypeFactory<T1,T2>

- All Implemented Interfaces:
    TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>, Tuples.TupleFactory<Tuples.Tuple2<T1,T2>>
  Enclosing class:
    Tuples

      protected static final class Tuples.Tuple2TypeFactory<T1,T2>
      extends Object
      implements TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>, Tuples.TupleFactory<Tuples.Tuple2<T1,T2>>

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Tuples.Tuple2TypeFactory(TypeSystem.TypeFactory<T1> type1, TypeSystem.TypeFactory<T2> type2)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `asReadableString(Object value)` Get a readable and potentially shorter string representation of the supplied value.
    `String` | `asString(Object value)` Get the string representation of the supplied value.
    `Tuples.Tuple2<T1,T2>` | `create(Object value)` Create the typed representation of the value given the supplied object representation.
    `Tuples.Tuple2<T1,T2>` | `create(String value)` Create the typed representation of the value given the supplied string representation.
    `Comparator<Tuples.Tuple2<T1,T2>>` | `getComparator()` Get a comparator that can be used to store the values of this type.
    `org.mapdb.Serializer<Tuples.Tuple2<T1,T2>>` | `getSerializer(BufferManager bufferMgr)`
    `Class<Tuples.Tuple2<T1,T2>>` | `getType()` Get the class representing the value type.
    `String` | `getTypeName()` Get the name of the type created by this factory.
    `long` | `length(Object value)` Get the length of the supplied value.

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

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

- - ### Constructor Detail

    - #### Tuples.Tuple2TypeFactory

          protected Tuples.Tuple2TypeFactory(TypeSystem.TypeFactory<T1> type1,
                                  TypeSystem.TypeFactory<T2> type2)

  - ### Method Detail

    - #### getSerializer

          public org.mapdb.Serializer<Tuples.Tuple2<T1,T2>> getSerializer(BufferManager bufferMgr)

      Specified by:
        `getSerializer` in interface `Tuples.TupleFactory<Tuples.Tuple2<T1,T2>>`

    - #### getType

          public Class<Tuples.Tuple2<T1,T2>> getType()

      Description copied from interface: `TypeSystem.TypeFactory`
      Get the class representing the value type.
      Specified by:
        `getType` in interface `TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>`
      Returns:
        the value type; never null

    - #### getComparator

          public Comparator<Tuples.Tuple2<T1,T2>> getComparator()

      Description copied from interface: `TypeSystem.TypeFactory`
      Get a comparator that can be used to store the values of this type.
      Specified by:
        `getComparator` in interface `TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>`
      Returns:
        the comparator; never null

    - #### getTypeName

          public String getTypeName()

      Description copied from interface: `TypeSystem.TypeFactory`
      Get the name of the type created by this factory.
      Specified by:
        `getTypeName` in interface `TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>`
      Returns:
        the type name; never null and never empty or blank

    - #### create

          public Tuples.Tuple2<T1,T2> create(String value)
                                      throws ValueFormatException

      Description copied from interface: `TypeSystem.TypeFactory`
      Create the typed representation of the value given the supplied string representation.
      Specified by:
        `create` in interface `TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>`
      Parameters:
        `value` - the string representation of the value
      Returns:
        the typed representation, which will be an instance of the `type`
      Throws:
        `ValueFormatException` - if the string cannot be converted to a typed value

    - #### create

          public Tuples.Tuple2<T1,T2> create(Object value)
                                      throws ValueFormatException

      Description copied from interface: `TypeSystem.TypeFactory`
      Create the typed representation of the value given the supplied object representation.
      Specified by:
        `create` in interface `TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>`
      Parameters:
        `value` - the object representation of the value
      Returns:
        the typed representation, which will be an instance of the `type`
      Throws:
        `ValueFormatException` - if the object cannot be converted to a typed value

    - #### asString

          public String asString(Object value)

      Description copied from interface: `TypeSystem.TypeFactory`
      Get the string representation of the supplied value.
      Specified by:
        `asString` in interface `TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>`
      Parameters:
        `value` - the value
      Returns:
        the string representation; never null

    - #### length

          public long length(Object value)

      Description copied from interface: `TypeSystem.TypeFactory`
      Get the length of the supplied value.
      Specified by:
        `length` in interface `TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>`
      Parameters:
        `value` - the value
      Returns:
        the length; never negative

    - #### asReadableString

          public String asReadableString(Object value)

      Description copied from interface: `TypeSystem.TypeFactory`
      Get a readable and potentially shorter string representation of the supplied value.
      Specified by:
        `asReadableString` in interface `TypeSystem.TypeFactory<Tuples.Tuple2<T1,T2>>`
      Parameters:
        `value` - the value
      Returns:
        the readable string representation; never null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.