org.eclipse.rdf4j.model.impl

## Class SimpleBNode

- java.lang.Object
- - org.eclipse.rdf4j.model.impl.SimpleBNode

- All Implemented Interfaces:
    Serializable, BNode, Resource, Value
  Direct Known Subclasses:
    BNodeImpl, MemBNode, NativeBNode

      public class SimpleBNode
      extends Object
      implements BNode

  An simple default implementation of the `BNode` interface.
  Author:
    Arjohn Kampman
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SimpleBNode()` Creates a new, unitialized blank node.
    `protected` | `SimpleBNode(String id)` Creates a new blank node with the supplied identifier.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)` Compares a blank node object to another object.
    `String` | `getID()` retrieves this blank node's identifier.
    `int` | `hashCode()` The hash code of a blank node is defined as the hash code of its identifier: `id.hashCode()`.
    `protected void` | `setID(String id)`
    `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`

- - ### Constructor Detail

    - #### SimpleBNode

          protected SimpleBNode()

      Creates a new, unitialized blank node. This blank node's ID needs to be `set` before the normal methods can be used.

    - #### SimpleBNode

          protected SimpleBNode(String id)

      Creates a new blank node with the supplied identifier.
      Parameters:
        `id` - The identifier for this blank node, must not be `null`.

  - ### Method Detail

    - #### getID

          public String getID()

      Description copied from interface: `BNode`
      retrieves this blank node's identifier.
      Specified by:
        `getID` in interface `BNode`
      Returns:
        A blank node identifier.

    - #### setID

          protected void setID(String id)

    - #### 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: `BNode`
      Compares a blank node object to another object.
      Specified by:
        `equals` in interface `BNode`
      Overrides:
        `equals` in class `Object`
      Parameters:
        `o` - The object to compare this blank node to.
      Returns:
        `true` if the other object is an instance of `BNode` and their IDs are equal, `false` otherwise.

    - #### hashCode

          public int hashCode()

      Description copied from interface: `BNode`
      The hash code of a blank node is defined as the hash code of its identifier: `id.hashCode()`.
      Specified by:
        `hashCode` in interface `BNode`
      Overrides:
        `hashCode` in class `Object`
      Returns:
        A hash code for the blank node.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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