org.modeshape.jcr.value

## Class ValueTypeSystem.NodeKeyTypeFactory

- java.lang.Object
- - org.modeshape.jcr.value.ValueTypeSystem.NodeKeyTypeFactory

- All Implemented Interfaces:
    TypeSystem.TypeFactory<NodeKey>
  Enclosing class:
    ValueTypeSystem

      protected static class ValueTypeSystem.NodeKeyTypeFactory
      extends Object
      implements TypeSystem.TypeFactory<NodeKey>

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ValueTypeSystem.NodeKeyTypeFactory(ValueFactory<String> stringFactory)`

  - ### 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.
    `NodeKey` | `create(Object value)` Create the typed representation of the value given the supplied object representation.
    `NodeKey` | `create(String value)` Create the typed representation of the value given the supplied string representation.
    `Comparator<NodeKey>` | `getComparator()` Get a comparator that can be used to store the values of this type.
    `Class<NodeKey>` | `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

    - #### ValueTypeSystem.NodeKeyTypeFactory

          protected ValueTypeSystem.NodeKeyTypeFactory(ValueFactory<String> stringFactory)

  - ### Method Detail

    - #### getType

          public Class<NodeKey> getType()

      Description copied from interface: `TypeSystem.TypeFactory`
      Get the class representing the value type.
      Specified by:
        `getType` in interface `TypeSystem.TypeFactory<NodeKey>`
      Returns:
        the value type; 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<NodeKey>`
      Returns:
        the type name; never null and never empty or blank

    - #### 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<NodeKey>`
      Parameters:
        `value` - the value
      Returns:
        the string representation; never null

    - #### 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<NodeKey>`
      Parameters:
        `value` - the value
      Returns:
        the readable 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<NodeKey>`
      Parameters:
        `value` - the value
      Returns:
        the length; never negative

    - #### create

          public NodeKey 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<NodeKey>`
      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

    - #### create

          public NodeKey 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<NodeKey>`
      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

    - #### getComparator

          public Comparator<NodeKey> 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<NodeKey>`
      Returns:
        the comparator; never null

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