java.lang.Object
com.hedera.hashgraph.sdk.LedgerId
Internal utility class for ledger id manipulation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic LedgerIdfromBytes(byte[] bytes) Create a ledger id from a byte array.(package private) static LedgerIdfromByteString(com.google.protobuf.ByteString byteString) Create a ledger id from a string.static LedgerIdfromNetworkName(NetworkName networkName) Deprecated.static LedgerIdfromString(String string) Assign the ledger id via a string name or Hex encoded String.inthashCode()(package private) booleanAre we one of the three standard networks?booleanAre we on Mionnet?booleanAre we on Previewnet?booleanAre we on Testnet?byte[]toBytes()Create the byte array.(package private) com.google.protobuf.ByteStringExtract the byte string representation.Deprecated.toString()Extract the string representation.
-
Field Details
-
MAINNET
The mainnet ledger id -
TESTNET
The testnet ledger id -
PREVIEWNET
The previewnet ledger id
-
-
Constructor Details
-
LedgerId
LedgerId(byte[] idBytes) Constructor.- Parameters:
idBytes- the id (0=mainnet, 1=testnet, 2=previewnet, ...)
-
-
Method Details
-
fromString
Assign the ledger id via a string name or Hex encoded String.- Parameters:
string- the string containing the ledger id- Returns:
- the ledger id
-
fromBytes
Create a ledger id from a byte array.- Parameters:
bytes- the byte array- Returns:
- the ledger id
-
fromByteString
Create a ledger id from a string.- Parameters:
byteString- the string- Returns:
- the ledger id
-
fromNetworkName
Deprecated.Create a ledger id from a network name.- Parameters:
networkName- the network name- Returns:
- the ledger id
-
isMainnet
public boolean isMainnet()Are we on Mionnet?- Returns:
- is it mainnet
-
isTestnet
public boolean isTestnet()Are we on Testnet?- Returns:
- is it testnet
-
isPreviewnet
public boolean isPreviewnet()Are we on Previewnet?- Returns:
- is it previewnet
-
isKnownNetwork
boolean isKnownNetwork()Are we one of the three standard networks?- Returns:
- is it one of the three standard networks
-
toString
Extract the string representation. -
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- the byte array representation
-
toByteString
com.google.protobuf.ByteString toByteString()Extract the byte string representation.- Returns:
- the byte string representation
-
toNetworkName
Deprecated.Extract the network name.- Returns:
- the network name
-
equals
-
hashCode
public int hashCode()
-