Class SimpleIRI
java.lang.Object
org.eclipse.rdf4j.model.base.AbstractIRI
org.eclipse.rdf4j.model.impl.SimpleIRI
- All Implemented Interfaces:
Serializable, IRI, Resource, Value
- Direct Known Subclasses:
NativeIRI
The default implementation of the
IRI interface.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Value
Value.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this IRI to another object.Gets the local name part of this IRI.Gets the namespace part of this IRI.inthashCode()Computes the hash code of this IRI.protected voidsetIRIString(String iriString) protected voidsetIRIString(String namespace, String localname) Returns the String-value of a Value object.Methods inherited from class AbstractIRI
toStringMethods inherited from interface Resource
isResource
-
Constructor Details
-
SimpleIRI
protected SimpleIRI()Creates a new, un-initialized IRI. This IRI's string value needs to besetbefore the normal methods can be used. -
SimpleIRI
Creates a new IRI from the supplied string.Note that creating SimpleIRI objects directly via this constructor is not the recommended approach. Instead, use a
ValueFactory(obtained from your repository or by usingSimpleValueFactory.getInstance()) to create new IRI objects.- Parameters:
iriString- A String representing a valid, absolute IRI. May not benull.- Throws:
IllegalArgumentException- If the supplied IRI is not a valid (absolute) IRI.- See Also:
-
SimpleIRI
-
-
Method Details
-
setIRIString
-
setIRIString
-
stringValue
Description copied from interface:ValueReturns the String-value of a Value object. This returns either aLiteral's label, aIRI's URI or aBNode's ID.- Specified by:
stringValuein interfaceValue- Overrides:
stringValuein classAbstractIRI
-
getNamespace
-
getLocalName
-
hashCode
public int hashCode()Description copied from interface:IRIComputes the hash code of this IRI.- Specified by:
hashCodein interfaceIRI- Overrides:
hashCodein classAbstractIRI- Returns:
- a hash code for this IRI computed as
Value.stringValue().hashCode()
-
equals
Description copied from interface:IRICompares this IRI to another object.- Specified by:
equalsin interfaceIRI- Overrides:
equalsin classAbstractIRI- Parameters:
o- the object to compare this IRI to- Returns:
true, if the other object is an instance ofIRIand their string values are equal;false, otherwise
-