public abstract class AbstractNameBasedUuidCreator extends AbstractUuidCreator
| Modifier and Type | Field and Description |
|---|---|
protected static String |
MESSAGE_DIGEST_MD5 |
protected static String |
MESSAGE_DIGEST_SHA1 |
protected static String |
MESSAGE_DIGEST_SHA256 |
NIL_UUID, RFC4122_VARIANT_BITS, RFC4122_VERSION_BITS, version| Constructor and Description |
|---|
AbstractNameBasedUuidCreator(UuidVersion version,
String messageDigest)
This constructor receives the name of a message digest.
|
| Modifier and Type | Method and Description |
|---|---|
UUID |
create(String name)
Returns a name-based UUID without namespace.
|
UUID |
create(String namespace,
String name)
Returns a name-based UUID with a namespace and a name.
|
UUID |
create(UUID namespace,
String name)
Returns a name-based UUID with a namespace and a name.
### RFC-4122 - 4.3.
|
<T extends AbstractNameBasedUuidCreator> |
withNamespace(String namespace)
Sets a fixed namespace with in a fluent way.
|
<T extends AbstractNameBasedUuidCreator> |
withNamespace(UUID namespace)
Sets a fixed namespace with in a fluent way.
|
getVariantBits, getVersion, getVersionBits, setVariantBits, setVersionBits, validprotected static final String MESSAGE_DIGEST_MD5
protected static final String MESSAGE_DIGEST_SHA1
protected static final String MESSAGE_DIGEST_SHA256
public AbstractNameBasedUuidCreator(UuidVersion version, String messageDigest)
version - the version numbermessageDigest - a message digestpublic <T extends AbstractNameBasedUuidCreator> T withNamespace(UUID namespace)
T - the type parameternamespace - a namespace UUIDAbstractNameBasedUuidCreatorpublic <T extends AbstractNameBasedUuidCreator> T withNamespace(String namespace)
T - the type parameternamespace - a namespace stringAbstractNameBasedUuidCreatorpublic UUID create(String name)
create(UUID, String)name - a name stringpublic UUID create(String namespace, String name)
create(UUID, String)namespace - a namespace stringname - a name stringpublic UUID create(UUID namespace, String name)
namespace - a namespace UUIDname - a name stringCopyright © 2019. All rights reserved.