Package org.trellisldp.api
Class Metadata
- java.lang.Object
-
- org.trellisldp.api.Metadata
-
public final class Metadata extends Object
Metadata values used for resource composition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetadata.BuilderA mutable builder for aMetadataobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Metadata.Builderbuilder(IRI identifier)A mutable builder for aMetadataobject.static Metadata.Builderbuilder(Resource r)A mutable builder for aMetadataobject.Optional<BinaryMetadata>getBinary()Retrieve the binary metadata if this is an LDP NonRDFSource.Optional<IRI>getContainer()Get the container for this resource.IRIgetIdentifier()Get an identifier for this metadata.Optional<IRI>getInsertedContentRelation()Retrieve the inserted content relation if this is an LDP Indirect container.IRIgetInteractionModel()Get the LDP interaction model for this metadata.Optional<IRI>getMemberOfRelation()Retrieve the member of relation IRI.Optional<IRI>getMemberRelation()Retrieve the member relation if this is an LDP Direct or Indirect container.Optional<IRI>getMembershipResource()Retrieve the membership resource if this is an LDP Direct or Indirect container.Set<IRI>getMetadataGraphNames()Retrieve the associated metadata graph names.Optional<String>getRevision()Retrieve the revision value, if one exists.
-
-
-
Method Detail
-
builder
public static Metadata.Builder builder(IRI identifier)
A mutable builder for aMetadataobject.- Parameters:
identifier- the resource identifier- Returns:
- a builder for a
Metadataobject
-
builder
public static Metadata.Builder builder(Resource r)
A mutable builder for aMetadataobject.- Parameters:
r- the resource- Returns:
- a builder for a
Metadataobject
-
getIdentifier
public IRI getIdentifier()
Get an identifier for this metadata.- Returns:
- the identifier
-
getInteractionModel
public IRI getInteractionModel()
Get the LDP interaction model for this metadata.- Returns:
- the interaction model
-
getContainer
public Optional<IRI> getContainer()
Get the container for this resource.- Returns:
- the identifier for a container, if one exists.
- API Note:
- returning an empty Optional should indicate here that the resource is not contained by any parent resource. This may be because it is a root resource and therefore not contained by any other resource. Alternatively, it could mean that a PUT operation was used to create the resource.
-
getMembershipResource
public Optional<IRI> getMembershipResource()
Retrieve the membership resource if this is an LDP Direct or Indirect container.- Returns:
- the membership resource
- Implementation Requirements:
- Other LDP resource types will always return an empty
Optionalvalue
-
getMemberRelation
public Optional<IRI> getMemberRelation()
Retrieve the member relation if this is an LDP Direct or Indirect container.- Returns:
- the ldp:hasMemberRelation IRI
- Implementation Requirements:
- Other LDP resource types will always return an empty
Optionalvalue
-
getMemberOfRelation
public Optional<IRI> getMemberOfRelation()
Retrieve the member of relation IRI.- Returns:
- the ldp:isMemberOfRelation IRI
- Implementation Requirements:
- Other LDP resource types will always return an empty
Optionalvalue
-
getInsertedContentRelation
public Optional<IRI> getInsertedContentRelation()
Retrieve the inserted content relation if this is an LDP Indirect container.- Returns:
- the inserted content relation
- Implementation Requirements:
- Other LDP resource types will always return an empty
Optionalvalue
-
getBinary
public Optional<BinaryMetadata> getBinary()
Retrieve the binary metadata if this is an LDP NonRDFSource.- Returns:
- the binary metadata
- Implementation Requirements:
- Other LDP resource types will always return an empty
Optionalvalue
-
getMetadataGraphNames
public Set<IRI> getMetadataGraphNames()
Retrieve the associated metadata graph names.- Returns:
- any associated metadata graph names
-
-