Package dev.enola.data
Class MemoryRepositoryRW<T>
java.lang.Object
dev.enola.data.MemoryRepositoryRW<T>
- All Implemented Interfaces:
Provider<String,,T> ProviderFromIRI<T>,Repository<T>,RepositoryRW<T>,Store<T>
- Direct Known Subclasses:
ThingMemoryRepositoryRW
MemoryRepositoryRW is an in-memory
RepositoryRW implemented using a ConcurrentHashMap. It is suitable for us by multiple concurrent threads.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMemoryRepositoryRW(ImmutableList<Trigger<? extends T>> triggers) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.enola.data.ProviderFromIRI
getMethods inherited from interface dev.enola.data.Repository
list, listIRI, stream
-
Constructor Details
-
MemoryRepositoryRW
-
-
Method Details
-
map
-
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
-