Class UuidUtils

java.lang.Object
net.lucypoulton.squirtgun.util.UuidUtils

public class UuidUtils extends Object
Various utilities for formatting UUIDs.
  • Constructor Details

    • UuidUtils

      public UuidUtils()
  • Method Details

    • toString

      public static String toString(UUID uuid)
      Converts a UUID to a string, removing hyphens.
      Parameters:
      uuid - the UUID to convert to a string
      Returns:
      the string form of a UUID with no hyphens.
    • fromString

      public static UUID fromString(String name)
      Converts a UUID, either with or without dashes, to a string. Hyphens are optional.
      Parameters:
      name - the string to parse
      Returns:
      the parsed UUID
      Throws:
      IllegalArgumentException - if the provided string is incorrectly formatted