|
GigaSpaces XAP 10.0.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jini.id.UuidFactory
public final class UuidFactory
Provides static methods for creating Uuid
instances.
Included are methods to create a Uuid
with a given
128-bit value or a string representation of such a value, to
generate new Uuid
values, and to read a binary
representation of a Uuid
from a stream.
Method Summary | |
---|---|
static Uuid |
create(long bits0,
long bits1)
Creates a new Uuid with the specified 128-bit
value. |
static Uuid |
create(String s)
Creates a new Uuid with the 128-bit value
represented by the specified string. |
static Uuid |
generate()
Generates a new Uuid with 122 bits of its value
produced from a cryptographically strong random sequence. |
static Uuid |
read(InputStream in)
Creates a new Uuid with the 128-bit value obtained
by unmarshalling a binary representation from the supplied
InputStream . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Uuid create(long bits0, long bits1)
Uuid
with the specified 128-bit
value.
This method can be used to create a Uuid
with a
value that has been previously generated, perhaps by an
external mechanism.
bits0
- the most significant 64 bits of the 128-bit valuebits1
- the least significant 64 bits of the 128-bit value
Uuid
with the given valuepublic static Uuid create(String s)
Uuid
with the 128-bit value
represented by the specified string.
The supplied string representation must be in the format
defined by Uuid.toString
except that
uppercase hexadecimal digits are allowed.
s
- the string representation to create the
Uuid
with
Uuid
with the value represented by the
given string
IllegalArgumentException
- if the supplied string
representation does not conform to the specified format
NullPointerException
- if s
is
null
public static Uuid generate()
Uuid
with 122 bits of its value
produced from a cryptographically strong random sequence.
The value of a Uuid
returned by this method is
computationally difficult to guess and is highly likely to be
unique with respect to all other Uuid
values
returned by this method over space and time.
Specifically, this method creates a new Uuid
with the a variant
field of 0x2
, a
version
field of 0x4
, and the
remaining 122 bits of its value produced from a
cryptographically strong random sequence.
Uuid
SecureRandom
public static Uuid read(InputStream in) throws IOException
Uuid
with the 128-bit value obtained
by unmarshalling a binary representation from the supplied
InputStream
.
Specifically, this method reads 16 bytes from the stream,
and then it creates a new Uuid
with the 128-bit
value represented by those bytes interpreted in network
(big-endian) byte order.
in
- the InputStream
to read the
Uuid
from
Uuid
with the value unmarshalled from
the stream
IOException
- if an I/O exception occurs while performing
this operation
NullPointerException
- if in
is
null
|
GigaSpaces XAP 10.0.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |