Package org.fuin.ddd4j.ddd
Class AggregateVersion
- java.lang.Object
-
- org.fuin.objects4j.vo.AbstractIntegerValueObject
-
- org.fuin.ddd4j.ddd.AggregateVersion
-
- All Implemented Interfaces:
Serializable,Comparable<org.fuin.objects4j.vo.AbstractIntegerValueObject>,org.fuin.objects4j.vo.ValueObject,org.fuin.objects4j.vo.ValueObjectWithBaseType<Integer>
public final class AggregateVersion extends org.fuin.objects4j.vo.AbstractIntegerValueObjectVersion of an aggregate.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AggregateVersion(@NotNull @Min(0L) Integer version)Constructor with value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerasBaseType()static booleanisValid(Integer value)Returns the information if a given integer is a valid version.static booleanisValid(String value)Returns the information if a given string is a valid version.static voidrequireArgValid(@NotNull String name, Integer value)Verifies if the argument is valid and throws an exception if this is not the case.static voidrequireArgValid(@NotNull String name, String value)Verifies if the argument is valid and throws an exception if this is not the case.static AggregateVersionvalueOf(Integer value)Parses a version identifier.static AggregateVersionvalueOf(String value)Parses a version identifier.
-
-
-
Constructor Detail
-
AggregateVersion
public AggregateVersion(@NotNull @Min(0L) @NotNull @Min(0L) Integer version)Constructor with value.- Parameters:
version- Version.
-
-
Method Detail
-
asBaseType
public final Integer asBaseType()
-
isValid
public static boolean isValid(Integer value)
Returns the information if a given integer is a valid version.- Parameters:
value- Value to check. Anullvalue returnstrue.- Returns:
- TRUE if it's a valid version, else FALSE.
-
isValid
public static boolean isValid(String value)
Returns the information if a given string is a valid version.- Parameters:
value- Value to check. Anullvalue returnstrue.- Returns:
- TRUE if it's a valid version, else FALSE.
-
valueOf
public static AggregateVersion valueOf(Integer value)
Parses a version identifier.- Parameters:
value- Value to convert. Anullvalue returnsnull.- Returns:
- Converted value.
-
valueOf
public static AggregateVersion valueOf(String value)
Parses a version identifier.- Parameters:
value- Value to convert. Anullvalue returnsnull.- Returns:
- Converted value.
-
requireArgValid
public static void requireArgValid(@NotNull @NotNull String name, @Nullable Integer value) throws org.fuin.objects4j.common.ConstraintViolationExceptionVerifies 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.
-
requireArgValid
public static void requireArgValid(@NotNull @NotNull String name, @Nullable String value) throws org.fuin.objects4j.common.ConstraintViolationExceptionVerifies 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.
-
-