Interface Entity<T>
- All Known Subinterfaces:
AggregateRoot<T>
- All Known Implementing Classes:
DelegatingEntity,ImmutableAggregateRoot,ImmutableEntity,LazyAggregateRoot,ModifiableAggregateRoot,ModifiableEntity,NoOpEntity
public interface Entity<T>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final ThreadLocal<Boolean>static final ThreadLocal<Boolean> -
Method Summary
Modifier and TypeMethodDescriptionCollection<?>aliases()default <A> AancestorValue(Class<A> ancestorType) apply(DeserializingMessage eventMessage) apply(Collection<?> events) assertAndApply(Object payloadOrMessage) assertAndApply(Object... events) assertAndApply(Object payload, Metadata metadata) assertAndApply(Collection<?> events) assertLegal(Object command) assertThat(Entity.Validator<T, E> validator) default Set<Relationship>associations(Entity<?> previous) default Set<Relationship>dissociations(Entity<?> previous) Collection<? extends Entity<?>>entities()get()static StringgetAggregateId(HasMetadata message) static Class<?>getAggregateType(HasMetadata message) static LonggetSequenceNumber(HasMetadata message) default Longid()ifPresent(UnaryOperator<Entity<T>> action) static booleandefault booleanisEmpty()static booleandefault booleandefault booleanisRoot()default Stringdefault Longdefault <U> Optional<U>mapIfPresent(Function<Entity<T>, U> action) Entity<?>parent()playBackToCondition(Predicate<Entity<T>> condition) playBackToEvent(String eventId) possibleTargets(Object payload) previous()default Set<Relationship>default Entity<?>root()default Aggregatedefault longdefault Instanttype()update(UnaryOperator<T> function) withEventIndex(Long index, String messageId) withSequenceNumber(long sequenceNumber)
-
Field Details
-
loading
-
applying
-
AGGREGATE_ID_METADATA_KEY
- See Also:
-
AGGREGATE_TYPE_METADATA_KEY
- See Also:
-
AGGREGATE_SN_METADATA_KEY
- See Also:
-
-
Method Details
-
isLoading
static boolean isLoading() -
isApplying
static boolean isApplying() -
getAggregateId
-
getAggregateType
-
getSequenceNumber
-
id
Object id() -
type
-
withType
-
get
T get() -
isEmpty
default boolean isEmpty() -
isPresent
default boolean isPresent() -
ifPresent
-
mapIfPresent
-
idProperty
String idProperty() -
parent
Entity<?> parent() -
ancestorValue
-
aliases
Collection<?> aliases() -
isRoot
default boolean isRoot() -
root
-
lastEventId
-
lastEventIndex
-
highestEventIndex
-
withEventIndex
-
withSequenceNumber
-
timestamp
-
sequenceNumber
default long sequenceNumber() -
rootAnnotation
-
previous
-
playBackToEvent
-
playBackToCondition
-
entities
Collection<? extends Entity<?>> entities() -
allEntities
-
getEntity
-
relationships
-
associations
-
dissociations
-
update
-
apply
-
apply
-
apply
-
apply
-
apply
-
apply
-
assertLegal
- Throws:
E extends Exception
-
assertAndApply
-
assertAndApply
-
assertAndApply
-
assertAndApply
-
assertThat
- Throws:
E extends Exception
-
ensure
default <E extends Exception> Entity<T> ensure(Predicate<T> check, Function<T, E> errorProvider) throws E- Throws:
E extends Exception
-
possibleTargets
-