public class GUID extends Object implements Comparable<GUID>
Constructor and Description |
---|
GUID()
Constructor that generates a new GUID using the current process id,
Platform Id and timestamp with no tenant
|
GUID(byte[] bytes)
Constructor that takes a byte array as this GUID's content
|
GUID(int tenantId,
int platformId)
Constructor that generates a new GUID using the current process id and
timestamp
|
GUID(String idsource)
Build from String key
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(GUID guid) |
boolean |
equals(Object o) |
byte[] |
getBytes()
copy the uuid of this GUID, so that it can't be changed, and return it
|
int |
getCounter() |
String |
getId() |
static int |
getKeySize() |
byte[] |
getMacFragment()
Extract Platform id as bytes.
|
int |
getPlatformId()
Extract Platform id as int.
|
int |
getProcessId()
Extract process id and return as int
|
int |
getTenantId() |
long |
getTimestamp()
Extract timestamp and return as long
|
int |
getVersion()
extract version field as a hex char from raw GUID bytes
|
int |
hashCode() |
String |
toArk() |
String |
toArkName() |
String |
toBase32() |
String |
toBase64() |
String |
toHex() |
String |
toString() |
public static final String ARK
public GUID(byte[] bytes) throws InvalidArgumentException
bytes
- GUID contentInvalidArgumentException
public GUID(String idsource) throws InvalidArgumentException
idsource
- InvalidArgumentException
public GUID()
public GUID(int tenantId, int platformId)
tenantId
- tenant id between 0 and 2^30-1platformId
- platform Id between 0 and 2^31-1IllegalArgumentException
- if any of the argument are out
of rangepublic static int getKeySize()
public String toBase32()
public String toBase64()
public String toHex()
public String toArk()
public String getId()
public final int getVersion()
public final int getTenantId()
public final int getPlatformId()
public final byte[] getMacFragment()
public final int getProcessId()
public final long getTimestamp()
public final int getCounter()
public final String toArkName()
public byte[] getBytes()
public int compareTo(GUID guid)
compareTo
in interface Comparable<GUID>
Copyright © 2009–2020 Waarp. All rights reserved.