Class IndexAddress

java.lang.Object
com.exonum.binding.core.storage.indices.IndexAddress

public final class IndexAddress
extends java.lang.Object
An Exonum index address: a pair of the name and an optional id in a group, which identifies an Exonum index.

Index addresses are resolved relatively to database Access objects. An index address cannot be translated into a resolved address without the corresponding Access object.

  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    java.util.Optional<byte[]> getIdInGroup()
    Returns the index id in a group if it belongs to one, otherwise returns an empty optional.
    java.lang.String getName()
    Returns the name of the index or index group.
    int hashCode()  
    java.lang.String toString()  
    static IndexAddress valueOf​(java.lang.String name)
    Creates an address of an individual index.
    static IndexAddress valueOf​(java.lang.String groupName, byte[] idInGroup)
    Creates an address of an index belonging to an index group.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • valueOf

      public static IndexAddress valueOf​(java.lang.String name)
      Creates an address of an individual index.
      Parameters:
      name - the name of the index: a alphanumeric non-empty identifier of the index in the MerkleDB: [a-zA-Z0-9_.]
    • valueOf

      public static IndexAddress valueOf​(java.lang.String groupName, byte[] idInGroup)
      Creates an address of an index belonging to an index group.
      Parameters:
      groupName - the name of the index group: a alphanumeric non-empty identifier of the index group in the MerkleDB: [a-zA-Z0-9_.]
      idInGroup - the id of the index in group. See a caveat on index identifiers.
    • getName

      public java.lang.String getName()
      Returns the name of the index or index group.
    • getIdInGroup

      public java.util.Optional<byte[]> getIdInGroup()
      Returns the index id in a group if it belongs to one, otherwise returns an empty optional.
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object