Package com.amalgamasimulation.utils
Class ShortId
java.lang.Object
com.amalgamasimulation.utils.ShortId
Short unique human-readable identifier represented as "ABC-123-XYZ". Only
Latin capital letters and numbers are allowed in the string representation.
Unlike, ABC-123-XYZ
123-ABC-456
UUID, true uniqueness is not guaranteed but the shortness of
its format provides more human readability.
The allowed formats include:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ShortId
public ShortId()Creates a new unique instance ofShortId
-
-
Method Details
-
getValue
-
parse
Parses the given string and returns the instance ofShortId. Throws anIllegalFormatExceptionif the format is different from one of the following forms:- ABC-123-XYZ
- 123-ABC-456
- Parameters:
string-- Returns:
- new instance of ShortId
-
toString
-
hashCode
public int hashCode() -
equals
-