public final class UuidCreator extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static UuidLocalDomain |
LOCAL_DOMAIN_GROUP |
static UuidLocalDomain |
LOCAL_DOMAIN_ORG |
static UuidLocalDomain |
LOCAL_DOMAIN_PERSON |
static UuidNamespace |
NAMESPACE_DNS |
static UuidNamespace |
NAMESPACE_OID |
static UuidNamespace |
NAMESPACE_URL |
static UuidNamespace |
NAMESPACE_X500 |
| 限定符和类型 | 方法和说明 |
|---|---|
static UUID |
fromBytes(byte[] uuid)
从字节数组返回 UUID。
|
static UUID |
fromString(String uuid)
从字符串返回 UUID。
|
static UUID |
getDceSecurity(byte localDomain,
int localIdentifier)
UUIDv2
返回 DCE 安全唯一标识符 (UUIDv2)。
|
static UUID |
getDceSecurity(UuidLocalDomain localDomain,
int localIdentifier)
UUIDv2
返回 DCE 安全唯一标识符 (UUIDv2)。
|
static UUID |
getDceSecurityWithHash(byte localDomain,
int localIdentifier)
UUIDv2
返回 DCE 安全唯一标识符 (UUIDv2)。
|
static UUID |
getDceSecurityWithHash(UuidLocalDomain localDomain,
int localIdentifier)
UUIDv2
返回 DCE 安全唯一标识符 (UUIDv2)。
|
static UUID |
getDceSecurityWithMac(byte localDomain,
int localIdentifier)
UUIDv2
返回 DCE 安全唯一标识符 (UUIDv2)。
|
static UUID |
getDceSecurityWithMac(UuidLocalDomain localDomain,
int localIdentifier)
UUIDv2
返回 DCE 安全唯一标识符 (UUIDv2)。
|
static UUID |
getDceSecurityWithRandom(byte localDomain,
int localIdentifier)
UUIDv2
返回 DCE 安全唯一标识符 (UUIDv2)。
|
static UUID |
getDceSecurityWithRandom(UuidLocalDomain localDomain,
int localIdentifier)
UUIDv2
返回 DCE 安全唯一标识符 (UUIDv2)。
|
static UUID |
getMax()
返回最大 UUID。
|
static UUID |
getNameBasedMd5(byte[] name)
UUIDv3
返回使用 MD5 散列 (UUIDv3) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedMd5(String name)
UUIDv3
返回使用 MD5 散列 (UUIDv3) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedMd5(String namespace,
byte[] name)
Returns a name-based unique identifier that uses MD5 hashing (UUIDv3).
|
static UUID |
getNameBasedMd5(String namespace,
String name)
Returns a name-based unique identifier that uses MD5 hashing (UUIDv3).
|
static UUID |
getNameBasedMd5(String namespace,
UUID name)
Returns a name-based unique identifier that uses MD5 hashing (UUIDv3).
|
static UUID |
getNameBasedMd5(UUID name)
UUIDv3
返回使用 MD5 散列 (UUIDv3) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedMd5(UUID namespace,
byte[] name)
Returns a name-based unique identifier that uses MD5 hashing (UUIDv3).
|
static UUID |
getNameBasedMd5(UuidNamespace namespace,
byte[] name)
Returns a name-based unique identifier that uses MD5 hashing (UUIDv3).
|
static UUID |
getNameBasedMd5(UuidNamespace namespace,
String name)
Returns a name-based unique identifier that uses MD5 hashing (UUIDv3).
|
static UUID |
getNameBasedMd5(UuidNamespace namespace,
UUID name)
Returns a name-based unique identifier that uses MD5 hashing (UUIDv3).
|
static UUID |
getNameBasedMd5(UUID namespace,
String name)
UUIDv3
返回使用 MD5 散列 (UUIDv3) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedMd5(UUID namespace,
UUID name)
Returns a name-based unique identifier that uses MD5 hashing (UUIDv3).
|
static UUID |
getNameBasedSha1(byte[] name)
Returns a name-based unique identifier that uses SHA-1 hashing (UUIDv5).
|
static UUID |
getNameBasedSha1(String name)
Returns a name-based unique identifier that uses SHA-1 hashing (UUIDv5).
|
static UUID |
getNameBasedSha1(String namespace,
byte[] name)
UUIDv5
返回使用 SHA-1 散列 (UUIDv5) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedSha1(String namespace,
String name)
返回使用 SHA-1 散列 (UUIDv5) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedSha1(String namespace,
UUID name)
UUIDv5
返回使用 SHA-1 散列 (UUIDv5) 的基于名称的唯一标识符
|
static UUID |
getNameBasedSha1(UUID name)
Returns a name-based unique identifier that uses SHA-1 hashing (UUIDv5).
|
static UUID |
getNameBasedSha1(UUID namespace,
byte[] name)
Returns a name-based unique identifier that uses SHA-1 hashing (UUIDv5).
|
static UUID |
getNameBasedSha1(UuidNamespace namespace,
byte[] name)
UUIDv5
返回使用 SHA-1 散列 (UUIDv5) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedSha1(UuidNamespace namespace,
String name)
UUIDv5
返回使用 SHA-1 散列 (UUIDv5) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedSha1(UuidNamespace namespace,
UUID name)
UUIDv5
返回使用 SHA-1 散列 (UUIDv5) 的基于名称的唯一标识符。
|
static UUID |
getNameBasedSha1(UUID namespace,
String name)
Returns a name-based unique identifier that uses SHA-1 hashing (UUIDv5).
|
static UUID |
getNameBasedSha1(UUID namespace,
UUID name)
Returns a name-based unique identifier that uses SHA-1 hashing (UUIDv5).
|
static UUID |
getNil()
返回一个 Nil UUID。
|
static UUID |
getPrefixComb()
GUID
返回前缀 COMB GUID。
|
static UUID |
getRandomBased()
UUIDv4
|
static UUID |
getShortPrefixComb()
返回 n 短前缀 COMB GUID。
|
static UUID |
getShortSuffixComb()
GUID
返回一个短后缀 COMB GUID。
|
static UUID |
getSuffixComb()
GUID
返回后缀 COMB GUID。
|
static UUID |
getTimeBased()
UUIDv1
返回基于时间的唯一标识符 (UUIDv1)。
|
static UUID |
getTimeBased(java.time.Instant instant,
Integer clockseq,
Long nodeid)
UUIDv1
返回基于时间的唯一标识符 (UUIDv1)。
|
static UUID |
getTimeBasedWithHash()
UUIDv1
返回基于时间的唯一标识符 (UUIDv1)。
|
static UUID |
getTimeBasedWithMac()
UUIDv1
返回基于时间的唯一标识符 (UUIDv1)。
|
static UUID |
getTimeBasedWithRandom()
UUIDv1
返回基于时间的唯一标识符 (UUIDv1)。
|
static UUID |
getTimeOrdered()
UUIDv6
返回按时间排序的唯一标识符 (UUIDv6)。
|
static UUID |
getTimeOrdered(java.time.Instant instant,
Integer clockseq,
Long nodeid)
UUIDv6
返回按时间排序的唯一标识符 (UUIDv6)。
|
static UUID |
getTimeOrderedEpoch()
UUIDv7
返回使用 Unix Epoch (UUIDv7) 的按时间排序的唯一标识符。
|
static UUID |
getTimeOrderedEpochPlus1()
UUIDv7
返回使用 Unix Epoch (UUIDv7) 的按时间排序的唯一标识符。
|
static UUID |
getTimeOrderedEpochPlusN()
UUIDv7
返回使用 Unix Epoch (UUIDv7) 的按时间排序的唯一标识符。
|
static UUID |
getTimeOrderedWithHash()
UUIDv6
返回按时间排序的唯一标识符 (UUIDv6)。
|
static UUID |
getTimeOrderedWithMac()
UUIDv6
返回按时间排序的唯一标识符 (UUIDv6)。
|
static UUID |
getTimeOrderedWithRandom()
UUIDv6
返回按时间排序的唯一标识符 (UUIDv6)。
|
static byte[] |
toBytes(UUID uuid)
从 UUID 返回一个字节数组。
|
static String |
toString(UUID uuid)
从 UUID 返回一个字符串。
|
public static final UuidNamespace NAMESPACE_DNS
public static final UuidNamespace NAMESPACE_URL
public static final UuidNamespace NAMESPACE_OID
public static final UuidNamespace NAMESPACE_X500
public static final UuidLocalDomain LOCAL_DOMAIN_PERSON
public static final UuidLocalDomain LOCAL_DOMAIN_GROUP
public static final UuidLocalDomain LOCAL_DOMAIN_ORG
public static byte[] toBytes(UUID uuid)
uuid - UUIDInvalidUuidException - if the argument is invalidpublic static UUID fromBytes(byte[] uuid)
uuid - 一个字节数组InvalidUuidException - if the argument is invalidpublic static String toString(UUID uuid)
uuid - UUIDInvalidUuidException - if the argument is invalidpublic static UUID fromString(String uuid)
uuid - a UUID stringInvalidUuidException - if the argument is invalidpublic static UUID getNil()
public static UUID getMax()
public static UUID getRandomBased()
RandomBasedFactorypublic static UUID getTimeBased()
TimeBasedFactorypublic static UUID getTimeBasedWithMac()
TimeBasedFactorypublic static UUID getTimeBasedWithHash()
TimeBasedFactory,
MachineIdpublic static UUID getTimeBasedWithRandom()
TimeBasedFactorypublic static UUID getTimeBased(java.time.Instant instant, Integer clockseq, Long nodeid)
instant - 另一个瞬间clockseq - 0 和 2^14-1 之间的备用时钟序列nodeid - 0 到 2^48-1 之间的备用节点标识符TimeBasedFactorypublic static UUID getTimeOrdered()
TimeOrderedFactorypublic static UUID getTimeOrderedWithMac()
TimeOrderedFactorypublic static UUID getTimeOrderedWithHash()
TimeOrderedFactory,
MachineIdpublic static UUID getTimeOrderedWithRandom()
TimeOrderedFactorypublic static UUID getTimeOrdered(java.time.Instant instant, Integer clockseq, Long nodeid)
instant - 另一个瞬间clockseq - 0 到 2^14-1 之间的备用时钟序列nodeid - 0 到 2^48-1 之间的备用节点标识符TimeOrderedFactorypublic static UUID getTimeOrderedEpoch()
TimeOrderedEpochFactorypublic static UUID getTimeOrderedEpochPlus1()
TimeOrderedEpochFactorypublic static UUID getTimeOrderedEpochPlusN()
TimeOrderedEpochFactorypublic static UUID getNameBasedMd5(String name)
name - stringNameBasedMd5Factorypublic static UUID getNameBasedMd5(byte[] name)
name - byte arrayNameBasedMd5Factorypublic static UUID getNameBasedMd5(UUID name)
name - UUIDNameBasedMd5Factorypublic static UUID getNameBasedMd5(UUID namespace, String name)
namespace - 自定义命名空间name - 一个字符串UuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedMd5(UUID namespace, byte[] name)
namespace - a custom name space UUIDname - a byte arrayUuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedMd5(UUID namespace, UUID name)
namespace - a custom name space UUIDname - a UUIDUuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedMd5(String namespace, String name)
The name string is encoded into a sequence of bytes using UTF-8.
namespace - a custom name space UUID in string formatname - a stringInvalidUuidException - if namespace is invalidUuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedMd5(String namespace, byte[] name)
namespace - a custom name space UUID in string formatname - a byte arrayInvalidUuidException - if namespace is invalidUuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedMd5(String namespace, UUID name)
namespace - a custom name space UUID in string formatname - a UUIDInvalidUuidException - if namespace is invalidUuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedMd5(UuidNamespace namespace, String name)
The name string is encoded into a sequence of bytes using UTF-8.
Name spaces predefined by RFC-4122 (Appendix C):
namespace - a predefined name space enumerationname - a stringUuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedMd5(UuidNamespace namespace, byte[] name)
Name spaces predefined by RFC-4122 (Appendix C):
namespace - a predefined name space enumerationname - a byte arrayUuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedMd5(UuidNamespace namespace, UUID name)
Name spaces predefined by RFC-4122 (Appendix C):
namespace - a predefined name space enumerationname - a UUIDUuidNamespace,
NameBasedMd5Factorypublic static UUID getNameBasedSha1(String name)
The name string is encoded into a sequence of bytes using UTF-8.
name - a stringNameBasedSha1Factorypublic static UUID getNameBasedSha1(byte[] name)
name - a byte arrayNameBasedSha1Factorypublic static UUID getNameBasedSha1(UUID name)
name - a UUIDNameBasedSha1Factorypublic static UUID getNameBasedSha1(UUID namespace, String name)
The name string is encoded into a sequence of bytes using UTF-8.
namespace - a custom name space UUIDname - a stringUuidNamespace,
NameBasedSha1Factorypublic static UUID getNameBasedSha1(UUID namespace, byte[] name)
namespace - a custom name space UUIDname - a byte arrayUuidNamespace,
NameBasedSha1Factorypublic static UUID getNameBasedSha1(UUID namespace, UUID name)
namespace - a custom name space UUIDname - a UUIDUuidNamespace,
NameBasedSha1Factorypublic static UUID getNameBasedSha1(String namespace, String name)
namespace - 预定义的本地域枚举name - 本地标识符InvalidUuidException - if namespace is invalidUuidNamespace,
NameBasedSha1Factorypublic static UUID getNameBasedSha1(String namespace, byte[] name)
namespace - 预定义的本地域枚举name - 本地标识符InvalidUuidException - if namespace is invalidUuidNamespace,
NameBasedSha1Factorypublic static UUID getNameBasedSha1(String namespace, UUID name)
namespace - 预定义的本地域枚举name - 本地标识符InvalidUuidException - if namespace is invalidUuidNamespace,
NameBasedSha1Factorypublic static UUID getNameBasedSha1(UuidNamespace namespace, String name)
namespace - 预定义的本地域枚举name - 本地标识符UuidNamespace,
NameBasedSha1Factorypublic static UUID getNameBasedSha1(UuidNamespace namespace, byte[] name)
namespace - 预定义的本地域枚举name - 本地标识符UuidNamespace,
NameBasedSha1Factorypublic static UUID getNameBasedSha1(UuidNamespace namespace, UUID name)
namespace - 预定义的本地域枚举name - 本地标识符UuidNamespace,
NameBasedSha1Factorypublic static UUID getDceSecurity(byte localDomain, int localIdentifier)
localDomain - 预定义的本地域枚举localIdentifier - 本地标识符UuidLocalDomain,
DceSecurityFactorypublic static UUID getDceSecurityWithMac(byte localDomain, int localIdentifier)
localDomain - 预定义的本地域枚举localIdentifier - 本地标识符UuidLocalDomain,
DceSecurityFactorypublic static UUID getDceSecurityWithHash(byte localDomain, int localIdentifier)
localDomain - 预定义的本地域枚举localIdentifier - 本地标识符UuidLocalDomain,
DceSecurityFactorypublic static UUID getDceSecurityWithRandom(byte localDomain, int localIdentifier)
localDomain - 预定义的本地域枚举localIdentifier - 本地标识符UuidLocalDomain,
DceSecurityFactorypublic static UUID getDceSecurity(UuidLocalDomain localDomain, int localIdentifier)
localDomain - 预定义的本地域枚举localIdentifier - 本地标识符UuidLocalDomain,
DceSecurityFactorypublic static UUID getDceSecurityWithMac(UuidLocalDomain localDomain, int localIdentifier)
localDomain - 预定义的本地域枚举localIdentifier - 本地标识符UuidLocalDomain,
DceSecurityFactorypublic static UUID getDceSecurityWithHash(UuidLocalDomain localDomain, int localIdentifier)
localDomain - 预定义的本地域枚举localIdentifier - 本地标识符UuidLocalDomain,
DceSecurityFactorypublic static UUID getDceSecurityWithRandom(UuidLocalDomain localDomain, int localIdentifier)
localDomain - 预定义的本地域枚举localIdentifier - 本地标识符UuidLocalDomain,
DceSecurityFactorypublic static UUID getPrefixComb()
PrefixCombFactorypublic static UUID getSuffixComb()
SuffixCombFactorypublic static UUID getShortPrefixComb()
ShortPrefixCombFactorypublic static UUID getShortSuffixComb()
ShortSuffixCombFactoryCopyright © 2024. All rights reserved.