Enum Class NameCoinNetwork

java.lang.Object
java.lang.Enum<NameCoinNetwork>
org.consensusj.namecoin.jsonrpc.core.NameCoinNetwork
All Implemented Interfaces:
Serializable, Comparable<NameCoinNetwork>, Constable, org.bitcoinj.base.Network

public enum NameCoinNetwork extends Enum<NameCoinNetwork> implements org.bitcoinj.base.Network
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static NameCoinNetwork[] 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 NameCoinNetwork 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
    • toString

      public String toString()
      Return the canonical, lowercase, user-facing String for an enum
      Overrides:
      toString in class Enum<NameCoinNetwork>
      Returns:
      canonical lowercase value
    • id

      public String id()
      Return the network ID string (specified by a Network)
      Specified by:
      id in interface org.bitcoinj.base.Network
      Returns:
      The network ID string
    • legacyAddressHeader

      public int legacyAddressHeader()
      Header byte of base58 encoded legacy P2PKH addresses for this network.
      Specified by:
      legacyAddressHeader in interface org.bitcoinj.base.Network
      Returns:
      header byte as an int.
      See Also:
      • LegacyAddress.AddressHeader
    • legacyP2SHHeader

      public int legacyP2SHHeader()
      Header byte of base58 encoded legacy P2SH addresses for this network.
      Specified by:
      legacyP2SHHeader in interface org.bitcoinj.base.Network
      Returns:
      header byte as an int.
      See Also:
      • LegacyAddress.P2SHHeader
    • segwitAddressHrp

      Return the standard Bech32 SegwitAddress.SegwitHrp (as a String) for this network.
      Specified by:
      segwitAddressHrp in interface org.bitcoinj.base.Network
      Returns:
      The HRP as a (lowercase) string.
    • uriScheme

      public String uriScheme()
      The URI scheme for Bitcoin.
      Specified by:
      uriScheme in interface org.bitcoinj.base.Network
      Returns:
      string containing the URI scheme
      See Also:
    • hasMaxMoney

      public boolean hasMaxMoney()
      Specified by:
      hasMaxMoney in interface org.bitcoinj.base.Network
    • maxMoney

      public org.bitcoinj.base.Coin maxMoney()
      Specified by:
      maxMoney in interface org.bitcoinj.base.Network
    • exceedsMaxMoney

      public boolean exceedsMaxMoney(org.bitcoinj.base.Monetary amount)
      Specified by:
      exceedsMaxMoney in interface org.bitcoinj.base.Network
    • fromString

      public static Optional<NameCoinNetwork> fromString(String nameString)
      Find the BitcoinNetwork from a name string, e.g. "mainnet", "testnet" or "signet". A number of common alternate names are allowed too, e.g. "main" or "prod".
      Parameters:
      nameString - A name string
      Returns:
      An Optional containing the matching enum or empty
    • fromIdString

      public static Optional<NameCoinNetwork> fromIdString(String idString)
      Find the BitcoinNetwork from an ID String

      Note: ID_UNITTESTNET is not supported as an enum

      Parameters:
      idString - specifies the network
      Returns:
      An Optional containing the matching enum or empty