+ /**
+ * Default static builder which creates a v5 (SHA1) name based {@link UUID},
+ * using UTF-8 encoding. Use
+ * {@link #NameUuid(TypedUuid, String, Charset, boolean)} for more options.
+ */
+ public NameUuid(TypedUuid namespace, String name) {
+ this(namespace, name, StandardCharsets.UTF_8, true);
+ }
+
+ /** Static builder (an {@link TypedUuidFactory} may be more efficient). */
+ public NameUuid(TypedUuid namespace, String name, Charset encoding, boolean sha1) {
+ this(sha1 ? AbstractUuidFactory.createNameUUIDv5Static(namespace.uuid, name.getBytes(encoding))
+ : AbstractUuidFactory.createNameUUIDv5Static(namespace.uuid, name.getBytes(encoding)), namespace, name,
+ encoding);
+ }
+
+ /**
+ * Since no check is performed, the constructor is protected so that the object
+ * can only be built by the default methods of {@link TypedUuidFactory} (in this
+ * package) or by extending the class.
+ */