|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.filenet.api.util.Id
public class Id
Immutable class that represents GUID values. This class can be
constructed from either a String
or a byte array.
Field Summary | |
---|---|
static Id |
ZERO_ID
Convenience constant for the all-zero GUID. |
Constructor Summary | |
---|---|
Id(byte[] bytes)
Constructs an ID with an array of bytes representing its GUID value. |
|
Id(java.lang.String id)
Constructs an ID with a string representing its GUID value. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object arg)
Compares two IDs. |
int |
compareTo(java.lang.Object arg,
DatabaseType dbType)
Compares two IDs as is done in an MSSQL Server database search. |
static Id |
createId()
Generates an ID with an IETF Version 4 UUID value. |
boolean |
equals(java.lang.Object otherId)
Compares two IDs for logical equality. |
byte[] |
getBytes()
Returns a copy of this ID as an array of bytes. |
int |
hashCode()
Returns the hashcode for this ID. |
static boolean |
isId(java.lang.String value)
Determines if a String is an ID or not. |
java.lang.String |
toString()
Returns the string representation of this ID. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Id ZERO_ID
Constructor Detail |
---|
public Id(java.lang.String id)
{1234abcd-56ef-7a89-9fe8-7d65cd43ba21}
id
- GUID value in string format from which to construct an ID.public Id(byte[] bytes)
bytes
- GUID value in byte array format from which to construct an ID.Method Detail |
---|
public static Id createId()
java.security.SecureRandom
.
Id
object.public int compareTo(java.lang.Object arg)
this
is less than arg
,
1 if this
is greater than arg
,
and 0 if the IDs are equal.
This comparison is consistent with
how IDs are compared in the DB2 and Oracle databases, but does not match how
MSSQL Server compares IDs. For MSSQL Server databases, use
compareTo(arg, dbType)
.
compareTo
in interface java.lang.Comparable
arg
- A Java Object
representing the ID against which to compare this ID.
public int compareTo(java.lang.Object arg, DatabaseType dbType)
this
is less than arg
,
1 if this
is greater than arg
,
and 0 if the IDs are equal.
This comparison matches the way that the databases
compare IDs if done in a database search. dbType
may be null
if the comparison
algorithm does not need to match that of any particular database. Specifying null
for dbType
is the same as calling the single-parameter form of this method
(compareTo(arg)
.
arg
- The GUID against which to compare this GUID.dbType
- An instance of DatabaseType
; can be null
.
public boolean equals(java.lang.Object otherId)
equals
in class java.lang.Object
otherId
- The ID against which to compare this ID.
true
if otherId
is an Id
object and their
GUIDs are logically equal; otherwise, returns false
.public byte[] getBytes()
public int hashCode()
hashCode
in class java.lang.Object
public static boolean isId(java.lang.String value)
String
is an ID or not.
value
- The String
to verify.
true
if the provided String
is in GUID format;
otherwise, returns false
.public java.lang.String toString()
toString
in class java.lang.Object
String
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |