java.lang.Object
org.fuin.ddd4j.ddd.AggregateRootUuid
- All Implemented Interfaces:
Serializable,Comparable<AggregateRootUuid>,AggregateRootId,EntityId,TechnicalId,org.fuin.objects4j.vo.ValueObject,org.fuin.objects4j.vo.ValueObjectWithBaseType<UUID>
public abstract class AggregateRootUuid
extends Object
implements AggregateRootId, Comparable<AggregateRootUuid>, org.fuin.objects4j.vo.ValueObjectWithBaseType<UUID>
UUID based aggregate root identifier.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAggregateRootUuid(@NotNull EntityType entityType) Constructor with entity type.AggregateRootUuid(@NotNull EntityType entityType, @NotNull UUID uuid) Constructor with UUID. -
Method Summary
Modifier and TypeMethodDescriptionfinal UUIDfinal StringasString()Returns the entity identifier as string.final StringReturns the entity identifier as string with type and identifier.final intcompareTo(AggregateRootUuid other) final booleanfinal EntityTypegetType()Returns the type represented by this identifier.final inthashCode()static booleanVerifies that a given string can be converted into the type.static voidrequireArgValid(@NotNull String name, @NotNull String value) Verifies if the argument is valid and throws an exception if this is not the case.final StringtoString()
-
Constructor Details
-
AggregateRootUuid
Constructor with entity type.- Parameters:
entityType- Entity type.
-
AggregateRootUuid
Constructor with UUID.- Parameters:
entityType- Entity type.uuid- UUID.
-
-
Method Details
-
hashCode
public final int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<AggregateRootUuid>
-
toString
-
asString
Description copied from interface:EntityIdReturns the entity identifier as string. -
asTypedString
Description copied from interface:EntityIdReturns the entity identifier as string with type and identifier.- Specified by:
asTypedStringin interfaceEntityId- Returns:
- Type and identifier.
-
getType
Description copied from interface:EntityIdReturns the type represented by this identifier. -
getBaseType
- Specified by:
getBaseTypein interfaceorg.fuin.objects4j.vo.ValueObjectWithBaseType<UUID>
-
asBaseType
- Specified by:
asBaseTypein interfaceorg.fuin.objects4j.vo.ValueObjectWithBaseType<UUID>
-
isValid
Verifies that a given string can be converted into the type.- Parameters:
value- Value to validate.- Returns:
- Returns
trueif it's a valid type elsefalse.
-
requireArgValid
public static void requireArgValid(@NotNull @NotNull String name, @NotNull @NotNull String value) throws org.fuin.objects4j.common.ConstraintViolationException Verifies if the argument is valid and throws an exception if this is not the case.- Parameters:
name- Name of the value for a possible error message.value- Value to check.- Throws:
org.fuin.objects4j.common.ConstraintViolationException- The value was not valid.
-