Package dev.enola.thing.repo
Interface ThingProvider
- All Superinterfaces:
Provider<String,,Thing> ProviderFromIRI<Thing>
- All Known Subinterfaces:
ThingRepository,ThingRepositoryStore,ThingsRepository
- All Known Implementing Classes:
AlwaysThingProvider,AlwaysThingProviderAdapter,AlwaysThingRepositoryStore,EmptyThingsRepository,MetaThingProvider,ProtoToThingRepository,StackedThingProvider,TemplateThingRepository,ThingMemoryRepositoryROBuilder,ThingMemoryRepositoryRW,ThingProviderAdapter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Provides
Things.
Intentionally named a *Provider and not a *Repository, because implementations may or may not "fetch from" a "data store" (which *Repository often implies); as some might indeed, but others may well not, and just "conjure up" new Things out of thin air, based solely on the IRI!
See ProtoThingProvider for a Proto Thing variant (this is for the Java Thing).
See AlwaysThingProvider for a NonNull variant.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ThingProviderThingProvider which is looked up in theTLC. -
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Thing,B extends Thing.Builder<T>>
Iterable<T> Deprecated.@Nullable ThingGet the Thing.default <T extends Thing>
@Nullable TDeprecated.default <T extends Thing,B extends Thing.Builder<T>>
Tdefault Thing.Builder<?> getBuilder(String iri) default <T extends Thing,B extends Thing.Builder<T>>
BgetBuilder(String iri, Class<T> thingClass, Class<B> thingBuilderClass) default Thing.Builder<?> getBuilder(String iri, String typeIRI) getOptional(String iri)
-
Field Details
-
CTX
ThingProvider which is looked up in theTLC.Consider possibly using
AlwaysThingProvider.CTXinstead.
-
-
Method Details
-
getBuilder
-
getBuilder
-
get
Get the Thing.- Specified by:
getin interfaceProvider<String,Thing> - Specified by:
getin interfaceProviderFromIRI<Thing>- Parameters:
iri- an IRI- Returns:
- a Thing [TODO: never null; but may be an empty Thing for an unknown IRI]
- Throws:
UncheckedIOException- if there was something at that IRI, but it could not be readConversionException- if there was a problem converting what was at the IRI to a Thing
-
getOptional
-
get
@Deprecated default <T extends Thing> @Nullable T get(String iri, Class<T> thingClass) throws UncheckedIOException, ConversionException Deprecated. -
getBuilder
default <T extends Thing,B extends Thing.Builder<T>> B getBuilder(String iri, Class<T> thingClass, Class<B> thingBuilderClass) -
get
-
get
-
get
Deprecated.
-