| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | CUID.
CUID Version 1. |
| private static class | CUID.
CUID Version 2. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final long | |
| private final String | value
CUID internal value holder. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(final CUID cuid)
Implements java. Compares this object with the specified object for order. |
| public boolean | equals(final Object
An object o)Overrides java. Returns |
| public static CUID | Returns: ACUID with the specified valueA string that specifies a cuidAsString)CUID (Version 1 or 2)Creates a |
| public int | |
| public static boolean | |
| public static CUID | |
| public static CUID | |
| public static CUID | Returns: Newly generated CUID (Version 2)requested CUID length length)Generates a new random CUID (Version 2). |
| private static int | |
| public String | Returns: String containing theCUIDOverrides java. Returns the string representation. |
| NUMBER_BASE | back to summary |
|---|---|
| private static final int NUMBER_BASE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| value | back to summary |
|---|---|
| private final String value CUID internal value holder. | |
| CUID | back to summary |
|---|---|
| private CUID(final String value) Creates a new instance.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(final CUID cuid) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Returns | |
| fromString | back to summary |
|---|---|
| public static CUID fromString(final String cuidAsString) Creates a
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Generates a hash code.
| |
| isValid | back to summary |
|---|---|
| public static boolean isValid(final String cuidAsString) Checks the
| |
| randomCUID1 | back to summary |
|---|---|
| public static CUID randomCUID1() Generates a new random CUID (Version 1).
| |
| randomCUID2 | back to summary |
|---|---|
| public static CUID randomCUID2() Generates a new random CUID (Version 2).
| |
| randomCUID2 | back to summary |
|---|---|
| public static CUID randomCUID2(final int length) Generates a new random CUID (Version 2).
| |
| safeAbs | back to summary |
|---|---|
| private static int safeAbs(final int i) Always return non-negative value.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the string representation. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final SecureRandom | |
| private static final byte[] | |
| private static final int | |
| private static int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| private static synchronized int | |
| private static String | Returns: The padded stringThe string to pad str, final int The size to keep size)Pads string with leading zero. |
| MACHINE_FINGERPRINT | back to summary |
|---|---|
| private static final String MACHINE_FINGERPRINT | |
| NUMBER_GENERATOR | back to summary |
|---|---|
| private static final SecureRandom NUMBER_GENERATOR | |
| RANDOM_BUFFER | back to summary |
|---|---|
| private static final byte[] RANDOM_BUFFER | |
| RANDOM_BUFFER_SIZE | back to summary |
|---|---|
| private static final int RANDOM_BUFFER_SIZE | |
| randomBufferIndex | back to summary |
|---|---|
| private static int randomBufferIndex | |
| Common | back to summary |
|---|---|
| private Common() | |
| getMachineFingerprint | back to summary |
|---|---|
| private static String getMachineFingerprint() retrieves the machine fingerprint.
| |
| nextIntValue | back to summary |
|---|---|
| private static synchronized int nextIntValue() Retrieves next random integer value.
| |
| padWithZero | back to summary |
|---|---|
| private static String padWithZero(final String str, final int size) Pads string with leading zero. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static int | |
| private static final int | |
| private static final int | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| private static synchronized int |
| BLOCK_SIZE | back to summary |
|---|---|
| private static final int BLOCK_SIZE | |
| counter | back to summary |
|---|---|
| private static int counter | |
| DISCRETE_VALUE | back to summary |
|---|---|
| private static final int DISCRETE_VALUE | |
| LENGTH_STANDARD | back to summary |
|---|---|
| private static final int LENGTH_STANDARD | |
| START_CHARACTER | back to summary |
|---|---|
| private static final String START_CHARACTER | |
| CUIDv1 | back to summary |
|---|---|
| private CUIDv1() | |
| getRandomBlock | back to summary |
|---|---|
| private static String getRandomBlock() Generates a random block of data.
| |
| nextCounterValue | back to summary |
|---|---|
| private static synchronized int nextCounterValue() Retrieves the counter next value.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final char[] | |
| private static int | |
| private static final int | |
| private static final int[] |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | Returns: String containing hashComputes hash. |
| private static String | Returns: String containing entropy in baseCUID#NUMBER_BASELength of the entropy string length)Creates an entropy string. |
| private static synchronized int |
| ALPHABET_ARRAY | back to summary |
|---|---|
| private static final char[] ALPHABET_ARRAY | |
| counter | back to summary |
|---|---|
| private static int counter | |
| LENGTH_STANDARD | back to summary |
|---|---|
| private static final int LENGTH_STANDARD | |
| PRIME_NUMBER_ARRAY | back to summary |
|---|---|
| private static final int[] PRIME_NUMBER_ARRAY | |
| CUIDv2 | back to summary |
|---|---|
| private CUIDv2() | |
| computeHash | back to summary |
|---|---|
| private static String computeHash(final String content, final int saltLength) Computes hash.
| |
| createEntropy | back to summary |
|---|---|
| private static String createEntropy(final int length) Creates an entropy string.
| |
| nextCounterValue | back to summary |
|---|---|
| private static synchronized int nextCounterValue() Retrieves the counter next value.
| |