Package dev.enola.thing
Interface PredicatesObjects
- All Known Subinterfaces:
Bookmark,Class,Class,Class.Builder<B>,Common,Common.Builder<B>,CreativeWork,Datatype,Datatype.Builder<B>,Enum,Enumeration,EnumValue,HasA,HasB,HasChildren,HasClass,HasComment,HasDescription,HasDirection,HasFileExtensions,HasIcon,HasLabel,HasLanguage,HasMediaType,HasName,HasName.Builder<B>,HasParent,HasSeeAlso,HasType,HasURL,IImmutablePredicatesObjects,IImmutableThing,MediaType,Package,Property,Property,Property.Builder<B>,Resource,Schema,Schema.Builder<B>,Speciality,Subject,Tag,TestSomething,Thing,Thing,ThingOrBuilder<B>,Type,Type,Type.Builder<B>,UnknownClass,WebPage
- All Known Implementing Classes:
DatatypeThing,ImmutablePredicatesObjects,ImmutableThing,MutablePredicatesObjects,MutableThing,OnlyIRIThing,PredicatesObjectsAdapter,ThingAdapter
public interface PredicatesObjects
PredicatesObjects is a "struct" of Predicates and their Objects.
Contrary to a Thing, this has no "identity" and thus no IRI. RDF calls this a "Blank
Node". This is informally often also referred to as a Things's Properties - it's just the Thing
without its identifying IRI.
It is typically used for objects "contained inside" Things (or their nested sub-structs).
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacePredicatesObjects.Builder<B extends PredicatesObjects> -
Method Summary
Modifier and TypeMethodDescriptionPredicatesObjects.Builder<? extends PredicatesObjects> copy()default @Nullable Stringdatatype(HasPredicateIRI predicateIRI) @Nullable StringIRI of datatype of predicate, if any (else null).Deprecated.default <T> @Nullable Tget(HasPredicateIRI predicate, Class<T> klass) Deprecated.<T> @Nullable TDeprecated.default <T> @Nullable Tdefault <T> @Nullable TDeprecated.default Collection<Object> Links, for predicate.default <T> Optional<T> getOptional(String predicateIRI, Class<T> klass) Object of predicate, with type conversion - as Optional.default @Nullable StringgetString(HasPredicateIRI predicate) default @Nullable StringDeprecated.default <T extends Thing,B extends Thing.Builder<T>>
Optional<T> default <T extends Thing>
TgetThingOrThrow(String predicateIRI, Class<T> klass) Deprecated.getThings(HasPredicateIRI predicate, Class<T> klass) Deprecated.default <T extends Thing,B extends Thing.Builder<T>>
Iterable<T> default booleandefault booleanisIterable(String predicateIRI) default booleanisLinkObject(@Nullable Object object) default booleandefault booleanIRIs of the Predicates of this Thing.Deprecated.
-
Method Details
-
properties
Deprecated.The Map's key is the IRI of a predicate, and the value is as would be returned byget(String). -
predicateIRIs
IRIs of the Predicates of this Thing. -
isLinkObject
-
isIterable
-
isOrdered
-
isStruct
-
datatype
IRI of datatype of predicate, if any (else null). Not all predicates will have a datatype set. This is required because the predicate's Object Java class is not necessarily unique; e.g. both dev.enola.model.schema.Datatypes.DATE as well as dev.enola.model.xsd.DATE are java.time.LocalDate instances. -
datatype
-
datatypes
Deprecated. -
get
Deprecated.Useget(String, Class)instead. -
get
Deprecated.Object of predicate, with type conversion - or failure.BEWARE: This may well fail and throw an
IllegalArgumentException! You can never really be sure what Java type an object of a predicate is. If in doubt, usegetOptional(String, Class), or perhapsget(String)with anObjectClassConverter. -
get
Deprecated. -
get
-
getOptional
Object of predicate, with type conversion - as Optional.- Returns:
- property as type, if set
- Throws:
IllegalStateException- if Datatype is not found, but neededConversionException- if known Datatype failed to convert
-
getString
-
getString
-
getThing
Deprecated. -
getThingOrThrow
Deprecated. -
getThing
-
getThings
Deprecated. -
getThings
-
getThings
-
getThings
-
getLinks
Links, for predicate.This transparently correctly handles if said predicate is not a link, a single link, or an iterable of which some elements are links.
- Returns:
- iterable objects which are links. Never null, but may well be empty. The type of the
contained elements can vary, and be either
String,URI,Link; it's possible to useObject.toString()to get the IRI of the link, becauseLink.toString()is implemented as expected.
-
hasLink
-
copy
PredicatesObjects.Builder<? extends PredicatesObjects> copy()
-
get(String, Class)instead.