Skip to content

Uuid

Overview

Module

UUID generation and validation. random() produces a Version 4 (random) UUID using the JDK's java.util.UUID.randomUUID(); validate(String) checks string conformance without throwing — useful for trusting or rejecting an inbound identifier before parsing it.

Use this rather than java.util.UUID.randomUUID().toString() when you want UUID generation to stay consistent with the rest of the platform.

Key Features:

  • Version-4 random UUIDs — backed by the JDK secure RNG.
  • Non-throwing validationvalidate returns a boolean rather than raising on malformed input.

Example Usage:

java
import org.eclipse.dirigible.sdk.utils.Uuid;

String id = Uuid.random();
boolean ok = Uuid.validate("550e8400-e29b-41d4-a716-446655440000");

Methods

random()

Produces a new Version 4 UUID.

java
public static String random();

Returns

  • Type: String
  • Description: The UUID as the canonical 36-character ASCII string.

validate()

Returns true if the supplied string is a syntactically valid UUID.

java
public static boolean validate(String uuid);
ParameterTypeDescription
uuidStringCandidate UUID string.

Returns

  • Type: boolean
  • Description: true if the string conforms to UUID syntax; false otherwise.

Released under the EPL-2.0 License.