Package org.axonframework.common
Class IdentifierValidator
java.lang.Object
org.axonframework.common.IdentifierValidator
Validates the structure of an object passed as Aggregate Identifier. These objects need to (properly) override
the
toString method. Two equal identifiers must always produce the same toString values,
even between JVM restarts. Typically, this also means equals and hashCode need to be
implemented.
For optimization purposes, this validator keeps a white-list of all aggregate types that have passed validation.
This
reduces the amount of reflection for types that have been already inspected.- Since:
- 2.0
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionstatic IdentifierValidatorReturns the singleton instance of the IdentifierValidator.booleanisValidIdentifier(Class<?> identifierType) Indicates whether or not the givenidentifierTypeis safe to use as aggregate identifier
-
Method Details
-
getInstance
Returns the singleton instance of the IdentifierValidator.- Returns:
- the IdentifierValidator instance
-
isValidIdentifier
Indicates whether or not the givenidentifierTypeis safe to use as aggregate identifier- Parameters:
identifierType- The class of the identifier- Returns:
trueif the identifier is valid,falseotherwise
-