Package com.apicatalog.rdf.primitive
Class Resource
- java.lang.Object
-
- com.apicatalog.rdf.primitive.Resource
-
- All Implemented Interfaces:
RdfResource,RdfTerm
public class Resource extends java.lang.Object implements RdfResource
-
-
Constructor Summary
Constructors Constructor Description Resource(java.lang.String value, boolean isBlankNode, java.lang.String key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResourcecreateBlankNode(java.lang.String value)(package private) static ResourcecreateBlankNode(java.lang.String value, java.lang.String key)static ResourcecreateIRI(java.lang.String value)(package private) static ResourcecreateIRI(java.lang.String value, java.lang.String key)booleanequals(java.lang.Object obj)Compares this RDF term to the specified object.inthashCode()Returns a hash code value for this RDF term.booleanisBlank()Checks whether this resource is a blank node.booleanisIRI()Checks whether this resource is an IRI.(package private) static java.lang.Stringkey(java.lang.String value, boolean blankNode)java.lang.StringtoString()Returns a string representation of this RDF term.java.lang.Stringvalue()Returns the value of the resource, typically an absolute IRI or blank node identifier.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.apicatalog.rdf.model.RdfResource
asResource, isResource
-
-
-
-
Method Detail
-
createBlankNode
public static Resource createBlankNode(java.lang.String value)
-
createBlankNode
static Resource createBlankNode(java.lang.String value, java.lang.String key)
-
createIRI
public static Resource createIRI(java.lang.String value)
-
createIRI
static Resource createIRI(java.lang.String value, java.lang.String key)
-
isBlank
public boolean isBlank()
Description copied from interface:RdfResourceChecks whether this resource is a blank node.A blank node is an anonymous resource that does not have an IRI.
- Specified by:
isBlankin interfaceRdfResource- Returns:
trueif this resource is a blank node,falseif it is an IRI
-
isIRI
public boolean isIRI()
Description copied from interface:RdfResourceChecks whether this resource is an IRI.An IRI (Internationalized Resource Identifier) is a globally unique identifier used to refer to a resource.
- Specified by:
isIRIin interfaceRdfResource- Returns:
trueif this resource is an IRI,falseif it is a blank node
-
value
public java.lang.String value()
Description copied from interface:RdfResourceReturns the value of the resource, typically an absolute IRI or blank node identifier.- Specified by:
valuein interfaceRdfResource- Returns:
- the value of the resource as a
String
-
hashCode
public int hashCode()
Description copied from interface:RdfTermReturns a hash code value for this RDF term.- Specified by:
hashCodein interfaceRdfTerm- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code consistent with
RdfTerm.equals(Object).
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:RdfTermCompares this RDF term to the specified object. Implementations must override this method to provide equality checks appropriate to the term type.
-
toString
public java.lang.String toString()
Description copied from interface:RdfTermReturns a string representation of this RDF term.
-
key
static final java.lang.String key(java.lang.String value, boolean blankNode)
-
-