A
- the aggregate type this specification applies to.I
- the aggregate identifier type.public class IdentitySpecification<A extends AggregateRoot<I>,I> extends Object implements Specification<A>
AggregateRoot
s and that is satisfied only if
the candidate aggregate has an identifier equal to the expected one.Constructor and Description |
---|
IdentitySpecification(I expectedIdentifier)
Creates a specification satisfied only if the candidate aggregate has an identifier equal to
the identifier passed as argument.
|
Modifier and Type | Method and Description |
---|---|
I |
getExpectedIdentifier()
Returns the identifier that is expected.
|
boolean |
isSatisfiedBy(A candidate)
Evaluates if the candidate object passed as argument satisfies the specification.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
and, any, asPredicate, negate, none, or
public IdentitySpecification(I expectedIdentifier)
expectedIdentifier
- the expected identifier.public boolean isSatisfiedBy(A candidate)
Specification
isSatisfiedBy
in interface Specification<A extends AggregateRoot<I>>
candidate
- the candidate object to check.public I getExpectedIdentifier()
Copyright © 2013-2018–2019 SeedStack. All rights reserved.