@Immutable
public class Acknowledgements
extends java.lang.Object
Constructor and Description |
---|
Acknowledgements(java.lang.Iterable<io.spine.core.Ack> responses) |
Modifier and Type | Method and Description |
---|---|
boolean |
containErrors()
Verifies if there was at least one error during command handling.
|
boolean |
containErrors(ErrorCriterion criterion)
Verifies if there was at least one error matching the passed criterion.
|
<T extends io.spine.base.RejectionMessage> |
containRejection(java.lang.Class<T> type,
RejectionCriterion<T> predicate)
Verifies if there is at least one rejection event which matches the passed criterion.
|
boolean |
containRejections()
Returns
true if there were any rejections in the Bounded Context,
false otherwise. |
boolean |
containRejections(io.spine.type.RejectionType type)
Verifies if there was a rejection of the passed class.
|
int |
count()
Obtains the total number of acknowledgements observed.
|
int |
countErrors()
Obtains a total number of errors in the acknowledgements.
|
long |
countErrors(ErrorCriterion criterion)
Count error matching the passed criterion.
|
int |
countRejections()
Obtains a total amount of rejections observed in Bounded Context.
|
<T extends io.spine.base.RejectionMessage> |
countRejections(java.lang.Class<T> type,
RejectionCriterion<T> predicate)
Counts a number of rejections matching the passed criterion.
|
int |
countRejections(io.spine.type.RejectionType type)
Obtains an amount of rejections of the provided type observed in the Bounded Context.
|
com.google.common.collect.ImmutableList<io.spine.base.Error> |
errors()
Obtains errors occurred during command handling.
|
public Acknowledgements(java.lang.Iterable<io.spine.core.Ack> responses)
public int count()
public boolean containErrors()
true
if errors did occur, false
otherwisepublic com.google.common.collect.ImmutableList<io.spine.base.Error> errors()
public int countErrors()
public boolean containErrors(ErrorCriterion criterion)
public long countErrors(ErrorCriterion criterion)
public boolean containRejections()
true
if there were any rejections in the Bounded Context,
false
otherwise.public int countRejections()
public boolean containRejections(io.spine.type.RejectionType type)
public int countRejections(io.spine.type.RejectionType type)
public <T extends io.spine.base.RejectionMessage> boolean containRejection(java.lang.Class<T> type, RejectionCriterion<T> predicate)
T
- a domain rejection typepredicate
- a domain message representing the rejectiontype
- a class of a domain rejectiontrue
if the rejection matching the predicate was observed,
false
otherwisepublic <T extends io.spine.base.RejectionMessage> long countRejections(java.lang.Class<T> type, RejectionCriterion<T> predicate)
T
- a domain rejection typepredicate
- a domain message representing the rejectiontype
- a class of a domain rejection