Package one.tranic.t.base.parse.uuid
Class UUIDParser
java.lang.Object
one.tranic.t.base.parse.uuid.UUIDParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable UUIDFormats a given string representation of a UUID into its canonical form with dashes.static @NotNull StringremoveDashes(@NotNull String uuidString) Removes all dashes from the given UUID string and converts it to lowercase.static @NotNull StringremoveDashes(@NotNull UUID uuid) Removes all dashes from the string representation of the given UUID.
-
Constructor Details
-
UUIDParser
public UUIDParser()
-
-
Method Details
-
format
Formats a given string representation of a UUID into its canonical form with dashes. The input must be a valid UUID string without dashes; otherwise, the method will return null.- Parameters:
uuidString- the input string representing a UUID, expected without dashes and non-null, must match the pattern of a valid UUID.- Returns:
- the formatted UUID as a
UUIDobject if the input matches a valid format; null otherwise.
-
removeDashes
Removes all dashes from the string representation of the given UUID.- Parameters:
uuid- the UUID from which to remove dashes, must not be null- Returns:
- the string representation of the UUID without dashes
-
removeDashes
Removes all dashes from the given UUID string and converts it to lowercase.- Parameters:
uuidString- the input string representing a UUID, expected to contain dashes and not null- Returns:
- the UUID string with all dashes removed, converted to lowercase
-