org.eclipse.emf.cdo.common.id

## Class CDOIDUtil

- java.lang.Object
- - org.eclipse.emf.cdo.common.id.CDOIDUtil

-     public final class CDOIDUtil
      extends java.lang.Object

  Various static methods that may help with CDO `IDs`.
  Since:
    2.0
  Author:
    Eike Stepper

- - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static AbstractCDOID` | `createCDOIDObject(CDOID.ObjectType subType)` Deprecated. As of 4.2 no longer supported. IDs can't be created without a value anymore.
    `static CDOIDExternal` | `createExternal(java.lang.String uri)`
    `static CDOIDAndBranch` | `createIDAndBranch(CDOID id, CDOBranch branch)`
    `static CDOIDAndVersion` | `createIDAndVersion(CDOIDAndVersion source)`
    `static CDOIDAndVersion` | `createIDAndVersion(CDOID id, int version)`
    `static CDOID` | `createLong(long value)`
    `static CDOID` | `createLongWithClassifier(CDOClassifierRef classifierRef, long value)` Deprecated. As of 4.2 use `createLongWithClassifier(long, CDOClassifierRef)`.
    `static CDOID` | `createLongWithClassifier(long value, CDOClassifierRef classifierRef)`
    `static <V> java.util.Map<CDOID,V>` | `createMap()`
    `static <V> java.util.Map<CDOID,V>` | `createMap(java.util.Map<? extends CDOID,? extends V> map)`
    `static CDOID` | `createString(java.lang.String value)`
    `static CDOID` | `createStringWithClassifier(CDOClassifierRef classifierRef, java.lang.String value)` Deprecated. As of 4.2 use `createStringWithClassifier(String, CDOClassifierRef)`.
    `static CDOID` | `createStringWithClassifier(java.lang.String value, CDOClassifierRef classifierRef)`
    `static CDOIDTemp` | `createTempObject(int value)`
    `static CDOIDExternal` | `createTempObjectExternal(java.lang.String uri)`
    `static CDOID` | `createUUID()`
    `static CDOID` | `createUUID(byte[] value)`
    `static byte[]` | `decodeUUID(java.lang.String string)`
    `static java.lang.String` | `encodeUUID(byte[] bytes)`
    `static boolean` | `equals(CDOID id1, CDOID id2)`
    `static byte[]` | `getByteArray(CDOID id)`
    `static CDOID` | `getCDOID(java.lang.Object object)`
    `static CDOClassifierRef` | `getClassifierRef(CDOID id)`
    `static long` | `getLong(CDOID id)`
    `static java.lang.String` | `getString(CDOID id)`
    `static boolean` | `isNull(CDOID id)`
    `static CDOID` | `read(CDODataInput in)`
    `static CDOID` | `read(ExtendedDataInput in)` Deprecated. As of 4.2 use `read(CDODataInput)`.
    `static CDOID` | `read(java.lang.String uriFragment)` Format of the URI fragment.
    `static void` | `write(CDODataOutput out, CDOID id)`
    `static void` | `write(ExtendedDataOutput out, CDOID id)` Deprecated. As of 4.2 use `write(CDODataOutput, CDOID)`.
    `static void` | `write(java.lang.StringBuilder builder, CDOID id)` Format of the uri fragment.
    `static void` | `write(java.lang.StringBuilder builder, java.lang.Iterable<?> objects)`

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

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

- - ### Method Detail

    - #### createMap

          public static <V> java.util.Map<CDOID,V> createMap()

      Since:
        4.2

    - #### createMap

          public static <V> java.util.Map<CDOID,V> createMap(java.util.Map<? extends CDOID,? extends V> map)

      Since:
        4.5

    - #### createIDAndVersion

          public static CDOIDAndVersion createIDAndVersion(CDOID id,
                                                           int version)

      Since:
        4.0

    - #### createIDAndVersion

          public static CDOIDAndVersion createIDAndVersion(CDOIDAndVersion source)

      Since:
        4.0

    - #### createIDAndBranch

          public static CDOIDAndBranch createIDAndBranch(CDOID id,
                                                         CDOBranch branch)

      Since:
        4.0

    - #### getCDOID

          public static CDOID getCDOID(java.lang.Object object)

      Since:
        4.2

    - #### isNull

          public static boolean isNull(CDOID id)

      Since:
        2.0

    - #### getLong

          public static long getLong(CDOID id)

    - #### getString

          public static java.lang.String getString(CDOID id)

      Since:
        4.0

    - #### getByteArray

          public static byte[] getByteArray(CDOID id)

      Since:
        4.1

    - #### getClassifierRef

          public static CDOClassifierRef getClassifierRef(CDOID id)

      Since:
        3.0

    - #### createTempObject

          public static CDOIDTemp createTempObject(int value)

    - #### createTempObjectExternal

          public static CDOIDExternal createTempObjectExternal(java.lang.String uri)

      Since:
        3.0

    - #### createLong

          public static CDOID createLong(long value)

    - #### createLongWithClassifier

          public static CDOID createLongWithClassifier(long value,
                                                       CDOClassifierRef classifierRef)

      Since:
        4.2

    - #### createString

          public static CDOID createString(java.lang.String value)

      Since:
        4.0

    - #### createStringWithClassifier

          public static CDOID createStringWithClassifier(java.lang.String value,
                                                         CDOClassifierRef classifierRef)

      Since:
        4.2

    - #### createUUID

          public static CDOID createUUID(byte[] value)

      Since:
        4.1

    - #### createUUID

          public static CDOID createUUID()

      Since:
        4.1

    - #### encodeUUID

          public static java.lang.String encodeUUID(byte[] bytes)

      Since:
        4.1

    - #### decodeUUID

          public static byte[] decodeUUID(java.lang.String string)

      Since:
        4.1

    - #### createExternal

          public static CDOIDExternal createExternal(java.lang.String uri)

      Since:
        2.0

    - #### write

          public static void write(java.lang.StringBuilder builder,
                                   java.lang.Iterable<?> objects)

      Since:
        4.5

    - #### write

          public static void write(java.lang.StringBuilder builder,
                                   CDOID id)

      Format of the uri fragment.

      Non-legacy: `<ID TYPE>/<CUSTOM STRING FROM OBJECT FACTORY>`

      Legacy: `<ID TYPE>/<PACKAGE URI>/<CLASSIFIER ID>/<CUSTOM STRING FROM OBJECT FACTORY>`

      Since:
        2.0

    - #### read

          public static CDOID read(java.lang.String uriFragment)

      Format of the URI fragment.

      Non-legacy: `<ID TYPE>/<CUSTOM STRING FROM OBJECT FACTORY>`

      Legacy: `<ID TYPE>/<PACKAGE URI>/<CLASSIFIER ID>/<CUSTOM STRING FROM OBJECT FACTORY>`

      Since:
        3.0

    - #### write

          public static void write(CDODataOutput out,
                                   CDOID id)
                            throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        4.2

    - #### read

          public static CDOID read(CDODataInput in)
                            throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        4.2

    - #### equals

          public static boolean equals(CDOID id1,
                                       CDOID id2)

      Since:
        2.0

    - #### createLongWithClassifier

          @Deprecated
          public static CDOID createLongWithClassifier(CDOClassifierRef classifierRef,
                                                                    long value)

      Deprecated. As of 4.2 use `createLongWithClassifier(long, CDOClassifierRef)`.
      Since:
        3.0

    - #### createStringWithClassifier

          @Deprecated
          public static CDOID createStringWithClassifier(CDOClassifierRef classifierRef,
                                                                      java.lang.String value)

      Deprecated. As of 4.2 use `createStringWithClassifier(String, CDOClassifierRef)`.
      Since:
        3.0

    - #### createCDOIDObject

          @Deprecated
          public static AbstractCDOID createCDOIDObject(CDOID.ObjectType subType)

      Deprecated. As of 4.2 no longer supported. IDs can't be created without a value anymore.
      Creates the correct implementation class for the passed `CDOID.ObjectType`.
      Parameters:
        `subType` - the subType for which to create an empty CDOID instance
      Returns:
        the instance of CDOIDObject which represents the subtype.
      Since:
        3.0

    - #### write

          @Deprecated
          public static void write(ExtendedDataOutput out,
                                                CDOID id)
                                         throws java.io.IOException

      Deprecated. As of 4.2 use `write(CDODataOutput, CDOID)`.
      Throws:
        `java.io.IOException`
      Since:
        4.1

    - #### read

          @Deprecated
          public static CDOID read(ExtendedDataInput in)
                                         throws java.io.IOException

      Deprecated. As of 4.2 use `read(CDODataInput)`.
      Throws:
        `java.io.IOException`
      Since:
        4.1

Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html