public class RevisionSnapshotFilter extends Object implements SnapshotFilter
SnapshotFilter
implementation which based on a configurable allowed revision will only SnapshotFilter.allow(DomainEventData)
DomainEventData
containing that revision. True will also be returned if the DomainEventData.getType()
does not match the given type
, as in compliance with the SnapshotFilter
documentation.Modifier and Type | Class and Description |
---|---|
static class |
RevisionSnapshotFilter.Builder
Builder class to instantiate a
RevisionSnapshotFilter . |
Modifier | Constructor and Description |
---|---|
protected |
RevisionSnapshotFilter(RevisionSnapshotFilter.Builder builder)
Instantiate a
RevisionSnapshotFilter based on the fields contained in the RevisionSnapshotFilter.Builder . |
|
RevisionSnapshotFilter(String allowedRevision)
Deprecated.
in favor of using the
RevisionSnapshotFilter.Builder |
Modifier and Type | Method and Description |
---|---|
static RevisionSnapshotFilter.Builder |
builder()
Instantiate a Builder to be able to create a
RevisionSnapshotFilter . |
boolean |
test(DomainEventData<?> domainEventData) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allow, allowAll, combine, rejectAll
protected RevisionSnapshotFilter(RevisionSnapshotFilter.Builder builder)
RevisionSnapshotFilter
based on the fields contained in the RevisionSnapshotFilter.Builder
.
Will assert that the type
is not null
or an empty String and the revision
is not an empty String and will throw an AxonConfigurationException
if this is the case.
builder
- the RevisionSnapshotFilter.Builder
used to instantiate a RevisionSnapshotFilter
instance@Deprecated public RevisionSnapshotFilter(String allowedRevision)
RevisionSnapshotFilter.Builder
RevisionSnapshotFilter
which returns true
on SnapshotFilter.allow(DomainEventData)
invocations where the DomainEventData
contains the given revision
.allowedRevision
- the revision which is allowed by this SnapshotFilter
public static RevisionSnapshotFilter.Builder builder()
RevisionSnapshotFilter
.
The type
is hard requirements and as such should be provided.
The revision
should not be an empty String
RevisionSnapshotFilter
public boolean test(DomainEventData<?> domainEventData)
test
in interface Predicate<DomainEventData<?>>
Copyright © 2010–2023. All rights reserved.