Package dev.enola.thing.repo
Class ThingMemoryRepositoryROBuilder
- All Implemented Interfaces:
Builder<Repository<Thing>>,Provider<String,,Thing> ProviderFromIRI<Thing>,Repository<Thing>,RepositoryRW<Thing>,Store<Thing>,ThingProvider,ThingRepository,ThingRepositoryStore
public class ThingMemoryRepositoryROBuilder
extends RepositoryBuilder<Thing>
implements ThingRepositoryStore
Builds a read-only Repository of
Things.
ThingMemoryRepositoryRW is one of possibly several other alternatives for this.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.enola.data.RepositoryBuilder
RepositoryBuilder.RepositoryImpl<T> -
Field Summary
Fields inherited from interface dev.enola.thing.repo.ThingProvider
CTX -
Constructor Summary
ConstructorsConstructorDescriptionThingMemoryRepositoryROBuilder(ImmutableList<Trigger<? extends Thing>> triggers) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Get.protected Stringlist()list() returns Ts directly (not just the IRIs, likeRepository.listIRI()).listIRI()Store a T.Store multiple Ts; seeStore.store(Object).protected voidMethods inherited from class dev.enola.data.RepositoryBuilder
buildMap, map, requireMethods 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
-
ThingMemoryRepositoryROBuilder
-
ThingMemoryRepositoryROBuilder
public ThingMemoryRepositoryROBuilder()
-
-
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").
-
storeAll
Description copied from interface:StoreStore multiple Ts; seeStore.store(Object). -
build
- Specified by:
buildin interfaceBuilder<Repository<Thing>>- Overrides:
buildin classRepositoryBuilder<Thing>
-
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
-