Package org.axonframework.serialization
Class FixedValueRevisionResolver
java.lang.Object
org.axonframework.serialization.FixedValueRevisionResolver
- All Implemented Interfaces:
RevisionResolver
RevisionResolver implementation that returns a fixed value as revision, regardless of the type of serialized object
involved. This can be useful when using the application version as Revision, for example.
- Since:
- 2.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionFixedValueRevisionResolver(String revision) Initializes the FixedValueRevisionResolver to always return the givenrevision, when asked. -
Method Summary
Modifier and TypeMethodDescriptionrevisionOf(Class<?> payloadType) Returns the revision for the givenpayloadType.
-
Constructor Details
-
FixedValueRevisionResolver
Initializes the FixedValueRevisionResolver to always return the givenrevision, when asked.- Parameters:
revision- The revision to return
-
-
Method Details
-
revisionOf
Description copied from interface:RevisionResolverReturns the revision for the givenpayloadType. The revision is used by upcasters to decide whether they need to process a certain serialized event. Generally, the revision needs to be modified each time the structure of an event has been changed in an incompatible manner.- Specified by:
revisionOfin interfaceRevisionResolver- Parameters:
payloadType- The type for which to return the revision- Returns:
- the revision for the given
payloadType
-