-
public class TypedID
-
-
Method Summary
Modifier and Type Method Description booleanequals(Object o)inthashCode()Array<byte>toBytes()Encodes the binary representation of this typed identifier to a byte array static TypedIDfromBytes(Array<byte> input)Decodes a binary representation of a typed identifier. StringtoString()Encodes the text representation of this typed identifier to a string static TypedIDnewWithRandomULID(String type)Generates a new typed identifier of the type {@code type}and with a new random ULID usingstatic TypedIDnewWithULID(String type, Ulid ulid)Generates a new typed identifier of the type {@code type}and with the ULID{@code ulid}.Does some sanity checks on the type and ULID.static TypedIDnewWithUUID(String type, UUID uuid)Generates a new typed identifier of the type {@code type}and with the UUID{@code uuid}.Does some sanity checks on the type and ULID.static TypedIDparse(String input)Parse parses the input string as a typed identifier. -
-
Method Detail
-
hashCode
int hashCode()
-
toBytes
Array<byte> toBytes()
Encodes the binary representation of this typed identifier to a byte array
-
fromBytes
static TypedID fromBytes(Array<byte> input)
Decodes a binary representation of a typed identifier.
- Parameters:
input- The bytes of the typed identifier
-
toString
@NonNull() String toString()
Encodes the text representation of this typed identifier to a string
-
newWithRandomULID
static TypedID newWithRandomULID(String type)
Generates a new typed identifier of the type
{@code type}and with a new random ULID using- Parameters:
type- The type of the typed identifier
-
newWithULID
static TypedID newWithULID(String type, Ulid ulid)
Generates a new typed identifier of the type
{@code type}and with the ULID{@code ulid}.Does some sanity checks on the type and ULID.- Parameters:
type- The type of the typed identifierulid- The ULID for the typed identifier
-
newWithUUID
static TypedID newWithUUID(String type, UUID uuid)
Generates a new typed identifier of the type
{@code type}and with the UUID{@code uuid}.Does some sanity checks on the type and ULID.- Parameters:
type- The type of the typed identifieruuid- The base UUID of the ULID for the typed identifier (
-
-
-
-