Enum Class HbarUnit

java.lang.Object
java.lang.Enum<HbarUnit>
com.hedera.hashgraph.sdk.HbarUnit
All Implemented Interfaces:
Serializable, Comparable<HbarUnit>, Constable

public enum HbarUnit extends Enum<HbarUnit>
Common units of hbar; for the most part they follow SI prefix conventions. See Hedera Documentation
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Equivalent to 1 billion hbar or 100 quadillion tinybar.
    The base unit of hbar, equivalent to 100 million tinybar.
    Equivalent to 1 thousand hbar or 100 billion tinybar.
    Equivalent to 1 million hbar or 100 trillion tinybar.
    Equivalent to 100 tinybar or 11,000,000 hbar.
    Equivalent to 100,000 tinybar or 11,000 hbar.
    The atomic (smallest) unit of hbar, used natively by the Hedera network.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final long
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the preferred symbol of the current unit.
    Get the name of this unit.
    static HbarUnit
    Returns the enum constant of this class with the specified name.
    static HbarUnit[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • TINYBAR

      public static final HbarUnit TINYBAR
      The atomic (smallest) unit of hbar, used natively by the Hedera network.

      It is equivalent to 1100,000,000 hbar.

    • MICROBAR

      public static final HbarUnit MICROBAR
      Equivalent to 100 tinybar or 11,000,000 hbar.
    • MILLIBAR

      public static final HbarUnit MILLIBAR
      Equivalent to 100,000 tinybar or 11,000 hbar.
    • HBAR

      public static final HbarUnit HBAR
      The base unit of hbar, equivalent to 100 million tinybar.
    • KILOBAR

      public static final HbarUnit KILOBAR
      Equivalent to 1 thousand hbar or 100 billion tinybar.
    • MEGABAR

      public static final HbarUnit MEGABAR
      Equivalent to 1 million hbar or 100 trillion tinybar.
    • GIGABAR

      public static final HbarUnit GIGABAR
      Equivalent to 1 billion hbar or 100 quadillion tinybar.

      The maximum hbar amount supported by Hedera in any context is ~92 gigabar (263 tinybar); use this unit sparingly.

  • Field Details

    • tinybar

      final long tinybar
  • Method Details

    • values

      public static HbarUnit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HbarUnit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSymbol

      public String getSymbol()
      Get the preferred symbol of the current unit.

      E.g. TINYBAR.getSymbol() returns "tℏ".

      Returns:
      the symbol
    • toString

      public String toString()
      Get the name of this unit.
      Overrides:
      toString in class Enum<HbarUnit>