Package org.eclipse.rdf4j.model.impl
Class SimpleTriple
java.lang.Object
org.eclipse.rdf4j.model.base.AbstractTriple
org.eclipse.rdf4j.model.impl.SimpleTriple
- All Implemented Interfaces:
Serializable,Resource,Triple,Value
A simple default implementation of the
Triple interface.- Author:
- Pavel Mihaylov
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleTriple(Resource subject, IRI predicate, Value object) Creates a new Triple with the supplied subject, predicate and object. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.model.Resource
isResource
-
Constructor Details
-
SimpleTriple
Creates a new Triple with the supplied subject, predicate and object.Note that creating SimpleStatement objects directly via this constructor is not the recommended approach. Instead, use an instance of
ValueFactoryto create new Triple objects.- Parameters:
subject- The triple's subject, must not be null.predicate- The triple's predicate, must not be null.object- The triple's object, must not be null.- See Also:
-
-
Method Details
-
getSubject
Description copied from interface:TripleGets the subject of this triple.- Returns:
- The triple's subject.
-
getPredicate
Description copied from interface:TripleGets the predicate of this triple.- Returns:
- The triple's predicate.
-
getObject
Description copied from interface:TripleGets the object of this triple.- Returns:
- The triple's object.
-
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 classAbstractTriple
-
toString
- Overrides:
toStringin classAbstractTriple
-
equals
Description copied from interface:TripleCompares this triple to another object.- Specified by:
equalsin interfaceTriple- Overrides:
equalsin classAbstractTriple- Parameters:
o- the object to compare this triple to- Returns:
trueif theotherobject is an instance ofTripleand if their subjects, predicates and objects are equal;falseotherwise
-
hashCode
public int hashCode()Description copied from interface:TripleComputes the hash code of this triple.- Specified by:
hashCodein interfaceTriple- Overrides:
hashCodein classAbstractTriple- Returns:
- a hash code for this triple computed as
Objects.hash(Triple.getSubject(),Triple.getPredicate(),Triple.getObject())
-