org.modeshape.jcr.value

## Class BinaryKey

- java.lang.Object
- - org.modeshape.jcr.value.BinaryKey

- All Implemented Interfaces:
    Serializable, Comparable<BinaryKey>

      @Immutable
      public class BinaryKey
      extends Object
      implements Serializable, Comparable<BinaryKey>

  The internal key used to identify a unique BINARY value.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BinaryKey(byte[] hash)`
    `BinaryKey(String key)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(BinaryKey other)`
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `static boolean` | `isProperlyFormattedKey(String hexadecimalStr)` Determine if the supplied hexadecimal string is potentially a binary key by checking the format of the string.
    `static BinaryKey` | `keyFor(byte[] content)`
    `static int` | `maxHexadecimalLength()`
    `static int` | `minHexadecimalLength()`
    `byte[]` | `toBytes()` Get this binary key in the form of a byte array.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### BinaryKey

          public BinaryKey(String key)

    - #### BinaryKey

          public BinaryKey(byte[] hash)

  - ### Method Detail

    - #### maxHexadecimalLength

          public static int maxHexadecimalLength()

    - #### minHexadecimalLength

          public static int minHexadecimalLength()

    - #### isProperlyFormattedKey

          public static boolean isProperlyFormattedKey(String hexadecimalStr)

      Determine if the supplied hexadecimal string is potentially a binary key by checking the format of the string.
      Parameters:
        `hexadecimalStr` - the hexadecimal string; may be null
      Returns:
        true if the supplied string is a properly formatted hexadecimal representation of a binary key, or false otherwise

    - #### keyFor

          public static BinaryKey keyFor(byte[] content)

    - #### toBytes

          public byte[] toBytes()

      Get this binary key in the form of a byte array.
      Returns:
        the bytes that make up this key; never null and always a copy to prevent modification

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### compareTo

          public int compareTo(BinaryKey other)

      Specified by:
        `compareTo` in interface `Comparable<BinaryKey>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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