org.eclipse.rdf4j.model

## Interface Statement

- All Superinterfaces:
    Serializable
  All Known Subinterfaces:
    ExtensibleStatement
  All Known Implementing Classes:
    AbstractStatement, ContextStatement, ContextStatementImpl, ExtensibleContextStatement, ExtensibleStatementImpl, LinkedHashModel.ModelStatement, MemStatement, SimpleStatement, StatementImpl, UnboundStatement

      public interface Statement
      extends Serializable

  An RDF statement, with optional associated context. A statement can have an associated context in specific cases, for example when fetched from a repository.

  Additional utility functionality for working with `Statement` objects is available in the `org.eclipse.rdf4j.model.util.Statements` utility class.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object other)` Compares this statement to another object.
    `Resource` | `getContext()` Gets the context of this statement.
    `Value` | `getObject()` Gets the object of this statement.
    `IRI` | `getPredicate()` Gets the predicate of this statement.
    `Resource` | `getSubject()` Gets the subject of this statement.
    `int` | `hashCode()` Computes the hash code of this statement.

- - ### Method Detail

    - #### getSubject

          Resource getSubject()

      Gets the subject of this statement.
      Returns:
        The statement's subject.

    - #### getPredicate

          IRI getPredicate()

      Gets the predicate of this statement.
      Returns:
        The statement's predicate.

    - #### getObject

          Value getObject()

      Gets the object of this statement.
      Returns:
        The statement's object.

    - #### getContext

          Resource getContext()

      Gets the context of this statement.
      Returns:
        The statement's context, or `null` in case of the null context or if not applicable.

    - #### equals

          boolean equals(Object other)

      Compares this statement to another object.
      Overrides:
        `equals` in class `Object`
      Parameters:
        `other` - the object to compare this statement to
      Returns:
        `true` if the other object is an instance of `Statement` and if their subjects, predicates, objects and contexts are equal; `false` otherwise

    - #### hashCode

          int hashCode()

      Computes the hash code of this statement.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        a hash code for this statement computed as `Objects.hash`( `getSubject()`, `getPredicate()`, `getObject()`, `getContext()`)

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