Class TripleImpl
- java.lang.Object
-
- org.apache.commons.rdf.rdf4j.impl.TripleImpl
-
- All Implemented Interfaces:
Triple
,TripleLike
,RDF4JTriple
,RDF4JTripleLike
final class TripleImpl extends java.lang.Object implements RDF4JTriple
-
-
Constructor Summary
Constructors Constructor Description TripleImpl(org.eclipse.rdf4j.model.Statement statement, java.util.UUID salt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.rdf4j.model.Statement
asStatement()
Return the corresponding RDF4JStatement
.boolean
equals(java.lang.Object obj)
Check it this Triple is equal to another Triple.RDFTerm
getObject()
IRI
getPredicate()
The predicateIRI
of this triple.BlankNodeOrIRI
getSubject()
The subject of this triple, which may be either aBlankNode
or anIRI
, which are represented in Commons RDF by the interfaceBlankNodeOrIRI
.int
hashCode()
Calculate a hash code for this Triple.java.lang.String
toString()
-
-
-
Method Detail
-
asStatement
public org.eclipse.rdf4j.model.Statement asStatement()
Description copied from interface:RDF4JTripleLike
Return the corresponding RDF4JStatement
.- Specified by:
asStatement
in interfaceRDF4JTripleLike
- Returns:
- The corresponding RDF4J Statement.
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:Triple
Check it this Triple is equal to another Triple.Two Triples are equal if and only if their
Triple.getSubject()
,Triple.getPredicate()
andTriple.getObject()
are equal.Implementations MUST also override
Triple.hashCode()
so that two equal Triples produce the same hash code.
-
getObject
public RDFTerm getObject()
Description copied from interface:Triple
The object of this triple, which may be either aBlankNode
, anIRI
, or aLiteral
, which are represented in Commons RDF by the interfaceRDFTerm
.- Specified by:
getObject
in interfaceTriple
- Specified by:
getObject
in interfaceTripleLike
- Returns:
- The object
RDFTerm
of this triple. - See Also:
- RDF-1.1 Triple object
-
getPredicate
public IRI getPredicate()
Description copied from interface:Triple
The predicateIRI
of this triple.- Specified by:
getPredicate
in interfaceTriple
- Specified by:
getPredicate
in interfaceTripleLike
- Returns:
- The predicate
IRI
of this triple. - See Also:
- RDF-1.1 Triple predicate
-
getSubject
public BlankNodeOrIRI getSubject()
Description copied from interface:Triple
The subject of this triple, which may be either aBlankNode
or anIRI
, which are represented in Commons RDF by the interfaceBlankNodeOrIRI
.- Specified by:
getSubject
in interfaceTriple
- Specified by:
getSubject
in interfaceTripleLike
- Returns:
- The subject
BlankNodeOrIRI
of this triple. - See Also:
- RDF-1.1 Triple subject
-
hashCode
public int hashCode()
Description copied from interface:Triple
Calculate a hash code for this Triple.The returned hash code MUST be equal to the result of
Objects.hash(Object...)
with the argumentsTriple.getSubject()
,Triple.getPredicate()
,Triple.getObject()
.This method MUST be implemented in conjunction with
Triple.equals(Object)
so that two equalTriple
s produce the same hash code.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-