org.eclipse.emf.cdo.common.id
Class CDOIDUtil

java.lang.Object
  extended by org.eclipse.emf.cdo.common.id.CDOIDUtil

public final class CDOIDUtil
extends Object

Various static methods that may help with CDO IDs.

Since:
2.0

Method Summary
static AbstractCDOID createCDOIDObject(CDOID.ObjectType subType)
          Creates the correct implementation class for the passed CDOID.ObjectType.
static CDOIDExternal createExternal(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)
           
static CDOID createString(String value)
           
static CDOID createStringWithClassifier(CDOClassifierRef classifierRef, String value)
           
static CDOIDTemp createTempObject(int value)
           
static CDOIDExternal createTempObjectExternal(String uri)
           
static CDOID createUUID()
           
static CDOID createUUID(byte[] value)
           
static byte[] decodeUUID(String string)
           
static String encodeUUID(byte[] bytes)
           
static boolean equals(CDOID id1, CDOID id2)
           
static byte[] getByteArray(CDOID id)
           
static CDOClassifierRef getClassifierRef(CDOID id)
           
static long getLong(CDOID id)
           
static String getString(CDOID id)
           
static boolean isNull(CDOID id)
           
static CDOID read(ExtendedDataInput in)
           
static CDOID read(String uriFragment)
          Format of the URI fragment.
static void write(ExtendedDataOutput out, CDOID id)
           
static void write(StringBuilder builder, CDOID id)
          Format of the uri fragment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNull

public static boolean isNull(CDOID id)
Since:
2.0

getLong

public static long getLong(CDOID id)

getString

public static 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(String uri)
Since:
3.0

createLong

public static CDOID createLong(long value)

createLongWithClassifier

public static CDOID createLongWithClassifier(CDOClassifierRef classifierRef,
                                             long value)
Since:
3.0

createString

public static CDOID createString(String value)
Since:
4.0

createStringWithClassifier

public static CDOID createStringWithClassifier(CDOClassifierRef classifierRef,
                                               String value)
Since:
3.0

createUUID

public static CDOID createUUID(byte[] value)
Since:
4.1

createUUID

public static CDOID createUUID()
Since:
4.1

encodeUUID

public static String encodeUUID(byte[] bytes)
Since:
4.1

decodeUUID

public static byte[] decodeUUID(String string)
Since:
4.1

createExternal

public static CDOIDExternal createExternal(String uri)
Since:
2.0

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

createCDOIDObject

public static AbstractCDOID createCDOIDObject(CDOID.ObjectType subType)
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

public static void write(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(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(ExtendedDataOutput out,
                         CDOID id)
                  throws IOException
Throws:
IOException
Since:
4.1

read

public static CDOID read(ExtendedDataInput in)
                  throws IOException
Throws:
IOException
Since:
4.1

equals

public static boolean equals(CDOID id1,
                             CDOID id2)
Since:
2.0


Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.