Package dev.enola.thing.repo
Class ThingMemoryRepositoryRW
- All Implemented Interfaces:
Provider<String,,Thing> ProviderFromIRI<Thing>,Repository<Thing>,RepositoryRW<Thing>,Store<Thing>,ThingProvider,ThingRepository,ThingRepositoryStore
@ThreadSafe
public class ThingMemoryRepositoryRW
extends MemoryRepositoryRW<Thing>
implements ThingRepositoryStore
ThingMemoryRepositoryRW is an in-memory read & write (i.e. both a
Store and a Repository of Things.
ThingMemoryRepositoryROBuilder is one of possibly several other alternatives for this.
-
Field Summary
Fields inherited from interface dev.enola.thing.repo.ThingProvider
CTX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet.protected Stringlist()list() returns Ts directly (not just the IRIs, likeRepository.listIRI()).listIRI()dev.enola.data.AbstractMapRepositoryRW<Thing> Store a T.protected voidMethods inherited from class dev.enola.data.MemoryRepositoryRW
mapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.enola.data.Repository
list, listIRI, streamMethods inherited from interface dev.enola.thing.repo.ThingProvider
get, get, get, get, get, getBuilder, getBuilder, getBuilder, getOptional
-
Constructor Details
-
ThingMemoryRepositoryRW
-
ThingMemoryRepositoryRW
public ThingMemoryRepositoryRW()
-
-
Method Details
-
getIRI
-
store
Description copied from interface:StoreStore a T.If this store already has this T, then it's replaced (entirely, not "merged").
-
list
Description copied from interface:Repositorylist() returns Ts directly (not just the IRIs, likeRepository.listIRI()).This default implementation here just combines
Repository.listIRI()andProviderFromIRI.get(String). Your subclass may be able to provide a more efficient and more "direct" implementation?- Specified by:
listin interfaceRepository<T>
-
listIRI
- Specified by:
listIRIin interfaceRepository<T>
-
get
Description copied from interface:ProviderGet.- Specified by:
getin interfaceProvider<String,T> - Specified by:
getin interfaceProviderFromIRI<T>- Parameters:
iri- Key, never null- Returns:
- value, or null if there is no Value for the given key
-
trigger
-