public abstract class AggregateRootUuid extends java.lang.Object implements AggregateRootId, java.lang.Comparable<AggregateRootUuid>, org.fuin.objects4j.vo.ValueObjectWithBaseType<java.util.UUID>
| Modifier and Type | Class and Description |
|---|---|
static interface |
AggregateRootUuid.AggregateRootUuidStr
Ensures that the string can be converted into the type.
|
static class |
AggregateRootUuid.Validator
Validates if a string is compliant with the type.
|
| Constructor and Description |
|---|
AggregateRootUuid(@NotNull EntityType entityType)
Constructor with entity type.
|
AggregateRootUuid(@NotNull EntityType entityType,
@NotNull java.util.UUID uuid)
Constructor with UUID.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.UUID |
asBaseType() |
java.lang.String |
asString()
Returns the entity identifier as string.
|
java.lang.String |
asTypedString()
Returns the entity identifier as string with type and identifier.
|
int |
compareTo(AggregateRootUuid other) |
boolean |
equals(java.lang.Object obj) |
java.lang.Class<java.util.UUID> |
getBaseType() |
EntityType |
getType()
Returns the type represented by this identifier.
|
int |
hashCode() |
static boolean |
isValid(java.lang.String value)
Verifies that a given string can be converted into the type.
|
static void |
requireArgValid(@NotNull java.lang.String name,
@NotNull java.lang.String value)
Verifies if the argument is valid and throws an exception if this is not the case.
|
java.lang.String |
toString() |
public AggregateRootUuid(@NotNull
@NotNull EntityType entityType)
entityType - Entity type.public AggregateRootUuid(@NotNull
@NotNull EntityType entityType,
@NotNull
@NotNull java.util.UUID uuid)
entityType - Entity type.uuid - UUID.public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final int compareTo(AggregateRootUuid other)
compareTo in interface java.lang.Comparable<AggregateRootUuid>public final java.lang.String toString()
toString in class java.lang.Objectpublic final java.lang.String asString()
EntityIdpublic final java.lang.String asTypedString()
EntityIdasTypedString in interface EntityIdpublic final EntityType getType()
EntityIdpublic final java.lang.Class<java.util.UUID> getBaseType()
getBaseType in interface org.fuin.objects4j.vo.ValueObjectWithBaseType<java.util.UUID>public final java.util.UUID asBaseType()
asBaseType in interface org.fuin.objects4j.vo.ValueObjectWithBaseType<java.util.UUID>public static boolean isValid(java.lang.String value)
value - Value to validate.true if it's a valid type else false.public static void requireArgValid(@NotNull
@NotNull java.lang.String name,
@NotNull
@NotNull java.lang.String value)
throws org.fuin.objects4j.common.ConstraintViolationException
name - Name of the value for a possible error message.value - Value to check.org.fuin.objects4j.common.ConstraintViolationException - The value was not valid.Copyright © 2019 fuin.org (Germany). All Rights Reserved.