org.eclipse.rdf4j.model

## Interface Namespace

- All Superinterfaces:
    Comparable<Namespace>, Serializable
  All Known Implementing Classes:
    AbstractNamespace, NamespaceImpl, SimpleNamespace

      public interface Namespace
      extends Serializable, Comparable<Namespace>

  A namespace, consisting of a namespace name and a prefix that has been assigned to it.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)` Compares this namespace to another object.
    `String` | `getName()` Gets the name of the current namespace (i.e.
    `String` | `getPrefix()` Gets the prefix of the current namespace.
    `int` | `hashCode()` Computes the hash code of this namespace.

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Method Detail

    - #### getPrefix

          String getPrefix()

      Gets the prefix of the current namespace. The default namespace is represented by an empty prefix string.
      Returns:
        prefix of namespace, or an empty string in case of the default namespace.

    - #### getName

          String getName()

      Gets the name of the current namespace (i.e. its IRI).
      Returns:
        name of namespace

    - #### equals

          boolean equals(Object o)

      Compares this namespace to another object.
      Overrides:
        `equals` in class `Object`
      Parameters:
        `o` - The object to compare this namespace to
      Returns:
        `true` if the other object is an instance of `Namespace` and their prefixes and names are equal, `false` otherwise.

    - #### hashCode

          int hashCode()

      Computes the hash code of this namespace.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        a hash code for this namespace computed as `Objects.hash`( `getPrefix()`, `getName()`)

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