Package org.fuin.ddd4j.ddd
Class AggregateNoCache<AGGREGATE>
- java.lang.Object
-
- org.fuin.ddd4j.ddd.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 Summary
Constructors Constructor Description AggregateNoCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AGGREGATEget(AggregateRootId aggregateId, Integer version)Tries to read the aggregate with the given identifier from the cache.voidput(AggregateRootId aggregateId, AGGREGATE aggregate)Puts an aggregate with the given identifier in the cache.voidremove(AggregateRootId aggregateId)Removes the aggregate with the given identifier from the cache.
-
-
-
Method Detail
-
get
public final AGGREGATE get(AggregateRootId aggregateId, Integer version)
Description copied from interface:AggregateCacheTries to read the aggregate with the given identifier from the cache.- Specified by:
getin interfaceAggregateCache<AGGREGATE>- Parameters:
aggregateId- Aggregate to load.version- Version to load ornullfor latest.- Returns:
- Cached aggregate or
nullif it was not found in the cache.
-
put
public void put(AggregateRootId aggregateId, AGGREGATE aggregate)
Description copied from interface:AggregateCachePuts an aggregate with the given identifier in the cache.- Specified by:
putin interfaceAggregateCache<AGGREGATE>- Parameters:
aggregateId- Aggregate to load.aggregate- Aggregate to cache.
-
remove
public final void remove(AggregateRootId aggregateId)
Description copied from interface:AggregateCacheRemoves the aggregate with the given identifier from the cache.- Specified by:
removein interfaceAggregateCache<AGGREGATE>- Parameters:
aggregateId- Aggregate to remove from cache.
-
-