Package dev.enola.thing.repo
Class AlwaysThingProvider
java.lang.Object
dev.enola.thing.repo.AlwaysThingProvider
- All Implemented Interfaces:
Provider<String,,Thing> ProviderFromIRI<Thing>,ThingProvider
- Direct Known Subclasses:
AlwaysThingProviderAdapter,AlwaysThingRepositoryStore
AlwaysThingProvider is a
ThingProvider which never returns null, but always a Thing.
The Thing WILL have the requested IRI - but if no such Thing is known (e.g. was pre-loaded, or could be fetched), then the returned Thing ONLY has an IRI - and no properties (nor datatypes).
This is useful in some situations where callers don't want to distinguish "non-existent"
Things; e.g. to have a ThingMetadataProvider always work, or so.
-
Field Summary
Fields -
Constructor Summary
Constructors -
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.thing.repo.ThingProvider
get, get, get, get, getBuilder, getBuilder, getBuilder, getOptional
-
Field Details
-
CTX
-
-
Constructor Details
-
AlwaysThingProvider
-
-
Method Details
-
get
Description copied from interface:ThingProviderGet the Thing.- Specified by:
getin interfaceProvider<String,Thing> - Specified by:
getin interfaceProviderFromIRI<Thing>- Specified by:
getin interfaceThingProvider- 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
-