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 class
Metadata.Builder
A mutable builder for aMetadata
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Metadata.Builder
builder(IRI identifier)
A mutable builder for aMetadata
object.static Metadata.Builder
builder(Resource r)
A mutable builder for aMetadata
object.Optional<BinaryMetadata>
getBinary()
Retrieve the binary metadata if this is an LDP NonRDFSource.Optional<IRI>
getContainer()
Get the container for this resource.IRI
getIdentifier()
Get an identifier for this metadata.Optional<IRI>
getInsertedContentRelation()
Retrieve the inserted content relation if this is an LDP Indirect container.IRI
getInteractionModel()
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 aMetadata
object.- Parameters:
identifier
- the resource identifier- Returns:
- a builder for a
Metadata
object
-
builder
public static Metadata.Builder builder(Resource r)
A mutable builder for aMetadata
object.- Parameters:
r
- the resource- Returns:
- a builder for a
Metadata
object
-
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
Optional
value
-
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
Optional
value
-
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
Optional
value
-
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
Optional
value
-
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
Optional
value
-
getMetadataGraphNames
public Set<IRI> getMetadataGraphNames()
Retrieve the associated metadata graph names.- Returns:
- any associated metadata graph names
-
-