org.eclipse.rdf4j.model.impl

## Class ContextStatement

- java.lang.Object
- - org.eclipse.rdf4j.model.impl.SimpleStatement
  - - org.eclipse.rdf4j.model.impl.ContextStatement

- All Implemented Interfaces:
    Serializable, Statement
  Direct Known Subclasses:
    ContextStatementImpl, MemStatement

      public class ContextStatement
      extends SimpleStatement

  An extension of `SimpleStatement` that adds a context field.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ContextStatement(Resource subject, IRI predicate, Value object, Resource context)` Creates a new Statement with the supplied subject, predicate and object for the specified associated context.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Resource` | `getContext()` Gets the context of this statement.
    `String` | `toString()` Gives a String-representation of this Statement that can be used for debugging.

    - ### Methods inherited from class org.eclipse.rdf4j.model.impl.SimpleStatement

      `equals, getObject, getPredicate, getSubject, hashCode`

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

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

- - ### Constructor Detail

    - #### ContextStatement

          protected ContextStatement(Resource subject,
                                     IRI predicate,
                                     Value object,
                                     Resource context)

      Creates a new Statement with the supplied subject, predicate and object for the specified associated context.
      Parameters:
        `subject` - The statement's subject, must not be `null`.
        `predicate` - The statement's predicate, must not be `null`.
        `object` - The statement's object, must not be `null`.
        `context` - The statement's context, `null` to indicate no context is associated.

  - ### Method Detail

    - #### getContext

          public Resource getContext()

      Description copied from interface: `Statement`
      Gets the context of this statement.
      Specified by:
        `getContext` in interface `Statement`
      Overrides:
        `getContext` in class `SimpleStatement`
      Returns:
        The statement's context, or `null` in case of the null context or if not applicable.

    - #### toString

          public String toString()

      Description copied from class: `SimpleStatement`
      Gives a String-representation of this Statement that can be used for debugging.
      Overrides:
        `toString` in class `SimpleStatement`

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