java.lang.Object
com.hedera.hashgraph.sdk.NftId
- All Implemented Interfaces:
Comparable<NftId>
The (non-fungible) token of which this NFT is an instance
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanstatic NftIdfromBytes(byte[] bytes) Create a new nft id from a byte array.(package private) static NftIdfromProtobuf(NftID nftId) Create a new ntf id from a protobuf.static NftIdfromString(String id) Create a new nft id from a string.inthashCode()byte[]toBytes()Create the byte array.(package private) NftIDCreate the protobuf.toString()toStringWithChecksum(Client client) Generate a string representation with checksum.
-
Field Details
-
tokenId
The (non-fungible) token of which this NFT is an instance -
serial
@Nonnegative public final long serialThe unique identifier of this instance
-
-
Constructor Details
-
NftId
Constructor.- Parameters:
tokenId- the token idserial- the serial number
-
-
Method Details
-
fromString
Create a new nft id from a string.- Parameters:
id- the string representation- Returns:
- the new nft id
-
fromProtobuf
Create a new ntf id from a protobuf.- Parameters:
nftId- the protobuf representation- Returns:
- the new nft id
-
fromBytes
public static NftId fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException Create a new nft id from a byte array.- Parameters:
bytes- the byte array- Returns:
- the new nft id
- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
toProtobuf
NftID toProtobuf()Create the protobuf.- Returns:
- a protobuf representation
-
toBytes
public byte[] toBytes()Create the byte array.- Returns:
- a byte array representation
-
toString
-
toStringWithChecksum
Generate a string representation with checksum.- Parameters:
client- the configured client- Returns:
- the string representation with checksum
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<NftId>
-