Class NodeAddressBook

java.lang.Object
com.hedera.hashgraph.sdk.NodeAddressBook

public class NodeAddressBook extends Object
A list of nodes and their metadata. See Hedera Documentation
  • Field Details

  • Constructor Details

    • NodeAddressBook

      NodeAddressBook()
      Constructor.
  • Method Details

    • getNodeAddresses

      public List<NodeAddress> getNodeAddresses()
      Extract the of node addresses.
      Returns:
      list of node addresses
    • setNodeAddresses

      public NodeAddressBook setNodeAddresses(List<NodeAddress> nodeAddresses)
      Assign the list of node addresses.
      Parameters:
      nodeAddresses - list of node addresses
      Returns:
      this
    • cloneNodeAddresses

      static List<NodeAddress> cloneNodeAddresses(List<NodeAddress> addresses)
    • fromProtobuf

      static NodeAddressBook fromProtobuf(NodeAddressBook book)
      Create a node address book from a protobuf.
      Parameters:
      book - the protobuf
      Returns:
      the new node address book
    • fromBytes

      public static NodeAddressBook fromBytes(com.google.protobuf.ByteString bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Create a node address book from a byte string.
      Parameters:
      bytes - the byte string
      Returns:
      the new node address book
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • toProtobuf

      NodeAddressBook toProtobuf()
      Create the protobuf.
      Returns:
      the protobuf representation
    • toBytes

      public com.google.protobuf.ByteString toBytes()
      Create the byte string.
      Returns:
      the byte string representation
    • toString

      public String toString()
      Overrides:
      toString in class Object