org.eclipse.rdf4j.model.base

## Class AbstractTriple

- java.lang.Object
- - org.eclipse.rdf4j.model.base.AbstractTriple

- All Implemented Interfaces:
    Serializable, Resource, Triple, Value
  Direct Known Subclasses:
    SimpleTriple

      public abstract class AbstractTriple
      extends Object
      implements Triple

  Base class for `Triple`, offering common functionality.
  Since:
    3.5.0
  Author:
    Alessandro Bollini
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTriple()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)` Compares this triple to another object.
    `int` | `hashCode()` Computes the hash code of this triple.
    `String` | `stringValue()` Returns the String-value of a `Value` object.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.model.Triple

      `getObject, getPredicate, getSubject, isTriple`

    - ### Methods inherited from interface org.eclipse.rdf4j.model.Resource

      `isResource`

    - ### Methods inherited from interface org.eclipse.rdf4j.model.Value

      `isBNode, isIRI, isLiteral`

- - ### Constructor Detail

    - #### AbstractTriple

          public AbstractTriple()

  - ### Method Detail

    - #### stringValue

          public String stringValue()

      Description copied from interface: `Value`
      Returns the String-value of a `Value` object. This returns either a `Literal`'s label, a `IRI`'s URI or a `BNode`'s ID.
      Specified by:
        `stringValue` in interface `Value`

    - #### equals

          public boolean equals(Object o)

      Description copied from interface: `Triple`
      Compares this triple to another object.
      Specified by:
        `equals` in interface `Triple`
      Overrides:
        `equals` in class `Object`
      Parameters:
        `o` - the object to compare this triple to
      Returns:
        `true` if the `other` object is an instance of `Triple` and if their subjects, predicates and objects are equal; `false` otherwise

    - #### hashCode

          public int hashCode()

      Description copied from interface: `Triple`
      Computes the hash code of this triple.
      Specified by:
        `hashCode` in interface `Triple`
      Overrides:
        `hashCode` in class `Object`
      Returns:
        a hash code for this triple computed as `Objects.hash`( `Triple.getSubject()`, `Triple.getPredicate()`, `Triple.getObject()`)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.