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.AbstractIntegerValueObject
Version of an aggregate.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Integerstatic booleanReturns the information if a given integer is a valid version.static booleanReturns 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 AggregateVersionParses a version identifier.static AggregateVersionParses a version identifier.Methods inherited from class org.fuin.objects4j.vo.AbstractIntegerValueObject
compareTo, equals, getBaseType, hashCode
-
Constructor Details
-
AggregateVersion
Constructor with value.- Parameters:
version- Version.
-
-
Method Details
-
asBaseType
-
isValid
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
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
Parses a version identifier.- Parameters:
value- Value to convert. Anullvalue returnsnull.- Returns:
- Converted value.
-
valueOf
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.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.
-
requireArgValid
public static void requireArgValid(@NotNull @NotNull String name, @Nullable 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.
-