Package org.bitcoinj.base
Enum Class SegwitAddress.SegwitHrp
- All Implemented Interfaces:
Serializable
,Comparable<SegwitAddress.SegwitHrp>
,Constable
- Enclosing class:
- SegwitAddress
Human-readable part (HRP) of Segwit addresses for standard Bitcoin networks.
See BIP 173 definition of bc
and tb
HRPs and
Bitcoin Core Issue 1234 - discussion of bcrt
HRP for details.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<SegwitAddress.SegwitHrp>
static SegwitAddress.SegwitHrp
static SegwitAddress.SegwitHrp
ofNetwork
(BitcoinNetwork network) toString()
Get the HRP in lowercase.static SegwitAddress.SegwitHrp
Returns the enum constant of this class with the specified name.static SegwitAddress.SegwitHrp[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BC
-
TB
-
BCRT
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
toString
Get the HRP in lowercase. To get uppercase, useEnum.name()
- Overrides:
toString
in classEnum<SegwitAddress.SegwitHrp>
- Returns:
- HRP in lowercase.
-
of
- Parameters:
hrp
- uppercase or lowercase HRP- Returns:
- the corresponding enum
- Throws:
IllegalArgumentException
- if unknown string
-
find
- Parameters:
hrp
- uppercase or lowercase HRP- Returns:
- Optional containing the corresponding enum or empty if not found
-
ofNetwork
- Parameters:
network
- network enum- Returns:
- the corresponding enum
-