nxt.peer

## Class BundlerRate

- java.lang.Object
- - nxt.peer.BundlerRate

-     public final class BundlerRate
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BundlerRate(java.nio.ByteBuffer buffer)` Create a signed bundler rate
    `BundlerRate(ChildChain chain, long accountId, long rate, long feeLimit)` Create an unsigned bundler rate
    `BundlerRate(ChildChain chain, long rate, long feeLimit, java.lang.String secretPhrase)` Create a signed bundler rate

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Check if two bundler rates are equal
    `long` | `getAccountId()` Get the account identifier
    `long` | `getBalance()` Get the account balance
    `void` | `getBytes(java.nio.ByteBuffer buffer)` Get our bytes
    `ChildChain` | `getChain()` Get the child chain
    `long` | `getFeeLimit()` Get the fee limit
    `int` | `getLength()` Get the encoded length
    `byte[]` | `getPublicKey()` Get the account public key
    `long` | `getRate()` Get the bundler rate
    `byte[]` | `getSignature()` Get the signature
    `int` | `getTimestamp()` Get the timestamp
    `byte[]` | `getUnsignedBytes()` Get the unsigned bytes
    `int` | `hashCode()` Get the hash code
    `void` | `setBalance(long balance)` Set the account balance

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

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

- - ### Constructor Detail

    - #### BundlerRate

          public BundlerRate(ChildChain chain,
                             long accountId,
                             long rate,
                             long feeLimit)

      Create an unsigned bundler rate
      Parameters:
        `chain` - Child chain
        `accountId` - Account identifier
        `rate` - Bundler rate
        `feeLimit` - Current fee limit

    - #### BundlerRate

          public BundlerRate(ChildChain chain,
                             long rate,
                             long feeLimit,
                             java.lang.String secretPhrase)

      Create a signed bundler rate
      Parameters:
        `chain` - Child chain
        `rate` - Bundler rate
        `feeLimit` - Current fee limit
        `secretPhrase` - Bundler account secret phrase

    - #### BundlerRate

          public BundlerRate(java.nio.ByteBuffer buffer)
                      throws java.nio.BufferUnderflowException,
                             nxt.peer.NetworkException

      Create a signed bundler rate
      Parameters:
        `buffer` - Encoded data
      Throws:
        `java.nio.BufferUnderflowException` - Encoded data is too short
        `NetworkException` - Encoded data is not valid

  - ### Method Detail

    - #### getLength

          public int getLength()

      Get the encoded length
      Returns:
        Encoded length

    - #### getBytes

          public void getBytes(java.nio.ByteBuffer buffer)

      Get our bytes
      Parameters:
        `buffer` - Byte buffer
      Throws:
        `java.nio.BufferOverflowException` - Allocated buffer is too small

    - #### getUnsignedBytes

          public byte[] getUnsignedBytes()

      Get the unsigned bytes
      Returns:
        Rate bytes

    - #### getChain

          public ChildChain getChain()

      Get the child chain
      Returns:
        Child chain

    - #### getAccountId

          public long getAccountId()

      Get the account identifier
      Returns:
        Account identifier

    - #### getPublicKey

          public byte[] getPublicKey()

      Get the account public key
      Returns:
        Account public key

    - #### getRate

          public long getRate()

      Get the bundler rate
      Returns:
        Rate

    - #### getFeeLimit

          public long getFeeLimit()

      Get the fee limit
      Returns:
        Fee limit

    - #### getTimestamp

          public int getTimestamp()

      Get the timestamp
      Returns:
        Timestamp

    - #### getSignature

          public byte[] getSignature()

      Get the signature
      Returns:
        Signature

    - #### getBalance

          public long getBalance()

      Get the account balance
      Returns:
        Account balance

    - #### setBalance

          public void setBalance(long balance)

      Set the account balance
      Parameters:
        `balance` - Account balance

    - #### hashCode

          public int hashCode()

      Get the hash code
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        Hash code

    - #### equals

          public boolean equals(java.lang.Object obj)

      Check if two bundler rates are equal
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - Bundler rate to compare
      Returns:
        TRUE if the rates are equal