Class AbstractAggregateRoot<ID extends AggregateRootId>

    • Constructor Detail

      • AbstractAggregateRoot

        public AbstractAggregateRoot()
        Default constructor.
    • Method Detail

      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • getVersion

        public final int getVersion()
        Description copied from interface: AggregateRoot
        Returns the current version of the aggregate.
        Specified by:
        getVersion in interface AggregateRoot<ID extends AggregateRootId>
        Returns:
        Current version that does NOT included uncommitted changes.
      • getNextVersion

        public final int getNextVersion()
        Description copied from interface: AggregateRoot
        Returns the next version of the aggregate.
        Specified by:
        getNextVersion in interface AggregateRoot<ID extends AggregateRootId>
        Returns:
        Next version that includes all currently uncommitted changes.
      • getIgnoredEvents

        protected final List<Class<? extends DomainEvent<?>>> getIgnoredEvents()
        Returns a list of old / ignored events. Sub classes can overwrite this method to ignore historic events that are not needed any more.
        Returns:
        Events that can be safely ignored.
      • apply

        protected final void apply​(@NotNull
                                   @NotNull DomainEvent<?> event)
        Applies the given new event. CAUTION: Don't use this method for applying historic events!
        Parameters:
        event - Event to dispatch to the appropriate event handler method.