Class UUIDParser

java.lang.Object
one.tranic.t.base.parse.uuid.UUIDParser

public class UUIDParser extends Object
  • Constructor Details

    • UUIDParser

      public UUIDParser()
  • Method Details

    • format

      @Nullable public static @Nullable UUID format(@NotNull @NotNull String uuidString)
      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 UUID object if the input matches a valid format; null otherwise.
    • removeDashes

      @NotNull public static @NotNull String removeDashes(@NotNull @NotNull UUID uuid)
      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

      @NotNull public static @NotNull String removeDashes(@NotNull @NotNull String uuidString)
      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