Package io.axoniq.dataprotection.serialization

## Class AnnotationRevisionResolver

- java.lang.Object
- - io.axoniq.dataprotection.serialization.AnnotationRevisionResolver

- All Implemented Interfaces:
    `RevisionResolver`

      public class AnnotationRevisionResolver
      extends Object
      implements RevisionResolver

  Revision Resolver implementation that checks for the presence of an `@Revision` annotation. The value of that annotation is returns as the revision of the payload it annotates. Note that `@Revision` is an inherited annotation, meaning that subclasses of annotated classes inherit the revision of their parent. This implementation returns `null` for objects that do not have a `@Revision` annotation.
  Since:
    2.0
  Author:
    Allard Buijze

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AnnotationRevisionResolver()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `revisionOf​(Class<?> payloadType)` | Returns the revision for the given `payloadType`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AnnotationRevisionResolver

          public AnnotationRevisionResolver()

  - ### Method Detail

    - #### revisionOf

          public String revisionOf​(Class<?> payloadType)

      Description copied from interface: `RevisionResolver`
      Returns the revision for the given `payloadType`. 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:
        `revisionOf` in interface `RevisionResolver`
      Parameters:
        `payloadType` - The type for which to return the revision
      Returns:
        the revision for the given `payloadType`