Class AggregateNoCache<AGGREGATE>

  • Type Parameters:
    AGGREGATE - Type of the aggregate.
    All Implemented Interfaces:
    AggregateCache<AGGREGATE>

    public final class AggregateNoCache<AGGREGATE>
    extends Object
    implements AggregateCache<AGGREGATE>
    Never caches anything.
    • Constructor Detail

      • AggregateNoCache

        public AggregateNoCache()
    • Method Detail

      • get

        public final AGGREGATE get​(AggregateRootId aggregateId,
                                   Integer version)
        Description copied from interface: AggregateCache
        Tries to read the aggregate with the given identifier from the cache.
        Specified by:
        get in interface AggregateCache<AGGREGATE>
        Parameters:
        aggregateId - Aggregate to load.
        version - Version to load or null for latest.
        Returns:
        Cached aggregate or null if it was not found in the cache.
      • put

        public void put​(AggregateRootId aggregateId,
                        AGGREGATE aggregate)
        Description copied from interface: AggregateCache
        Puts an aggregate with the given identifier in the cache.
        Specified by:
        put in interface AggregateCache<AGGREGATE>
        Parameters:
        aggregateId - Aggregate to load.
        aggregate - Aggregate to cache.
      • remove

        public final void remove​(AggregateRootId aggregateId)
        Description copied from interface: AggregateCache
        Removes the aggregate with the given identifier from the cache.
        Specified by:
        remove in interface AggregateCache<AGGREGATE>
        Parameters:
        aggregateId - Aggregate to remove from cache.