com.hedera.hashgraph.sdk.proto.TokenBalance Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-jdk7 Show documentation
Show all versions of sdk-jdk7 Show documentation
Hedera™ Hashgraph SDK for Java
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: basic_types.proto
package com.hedera.hashgraph.sdk.proto;
/**
*
**
* A number of <i>transferable units</i> of a certain token.
*
* The transferable unit of a token is its smallest denomination, as given by the token's
* <tt>decimals</tt> property---each minted token contains <tt>10<sup>decimals</sup></tt>
* transferable units. For example, we could think of the cent as the transferable unit of the US
* dollar (<tt>decimals=2</tt>); and the tinybar as the transferable unit of hbar
* (<tt>decimals=8</tt>).
*
* Transferable units are not directly comparable across different tokens.
*
*
* Protobuf type {@code proto.TokenBalance}
*/
public final class TokenBalance extends
com.google.protobuf.GeneratedMessageLite<
TokenBalance, TokenBalance.Builder> implements
// @@protoc_insertion_point(message_implements:proto.TokenBalance)
TokenBalanceOrBuilder {
private TokenBalance() {
}
public static final int TOKENID_FIELD_NUMBER = 1;
private com.hedera.hashgraph.sdk.proto.TokenID tokenId_;
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
@java.lang.Override
public boolean hasTokenId() {
return tokenId_ != null;
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TokenID getTokenId() {
return tokenId_ == null ? com.hedera.hashgraph.sdk.proto.TokenID.getDefaultInstance() : tokenId_;
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
private void setTokenId(com.hedera.hashgraph.sdk.proto.TokenID value) {
value.getClass();
tokenId_ = value;
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
@java.lang.SuppressWarnings({"ReferenceEquality"})
private void mergeTokenId(com.hedera.hashgraph.sdk.proto.TokenID value) {
value.getClass();
if (tokenId_ != null &&
tokenId_ != com.hedera.hashgraph.sdk.proto.TokenID.getDefaultInstance()) {
tokenId_ =
com.hedera.hashgraph.sdk.proto.TokenID.newBuilder(tokenId_).mergeFrom(value).buildPartial();
} else {
tokenId_ = value;
}
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
private void clearTokenId() { tokenId_ = null;
}
public static final int BALANCE_FIELD_NUMBER = 2;
private long balance_;
/**
*
**
* Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON -
* balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of
* NFTs held by the account
*
*
* uint64 balance = 2;
* @return The balance.
*/
@java.lang.Override
public long getBalance() {
return balance_;
}
/**
*
**
* Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON -
* balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of
* NFTs held by the account
*
*
* uint64 balance = 2;
* @param value The balance to set.
*/
private void setBalance(long value) {
balance_ = value;
}
/**
*
**
* Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON -
* balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of
* NFTs held by the account
*
*
* uint64 balance = 2;
*/
private void clearBalance() {
balance_ = 0L;
}
public static final int DECIMALS_FIELD_NUMBER = 3;
private int decimals_;
/**
*
**
* Tokens divide into <tt>10<sup>decimals</sup></tt> pieces
*
*
* uint32 decimals = 3;
* @return The decimals.
*/
@java.lang.Override
public int getDecimals() {
return decimals_;
}
/**
*
**
* Tokens divide into <tt>10<sup>decimals</sup></tt> pieces
*
*
* uint32 decimals = 3;
* @param value The decimals to set.
*/
private void setDecimals(int value) {
decimals_ = value;
}
/**
*
**
* Tokens divide into <tt>10<sup>decimals</sup></tt> pieces
*
*
* uint32 decimals = 3;
*/
private void clearDecimals() {
decimals_ = 0;
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry);
}
public static Builder newBuilder() {
return (Builder) DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(com.hedera.hashgraph.sdk.proto.TokenBalance prototype) {
return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);
}
/**
*
**
* A number of <i>transferable units</i> of a certain token.
*
* The transferable unit of a token is its smallest denomination, as given by the token's
* <tt>decimals</tt> property---each minted token contains <tt>10<sup>decimals</sup></tt>
* transferable units. For example, we could think of the cent as the transferable unit of the US
* dollar (<tt>decimals=2</tt>); and the tinybar as the transferable unit of hbar
* (<tt>decimals=8</tt>).
*
* Transferable units are not directly comparable across different tokens.
*
*
* Protobuf type {@code proto.TokenBalance}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageLite.Builder<
com.hedera.hashgraph.sdk.proto.TokenBalance, Builder> implements
// @@protoc_insertion_point(builder_implements:proto.TokenBalance)
com.hedera.hashgraph.sdk.proto.TokenBalanceOrBuilder {
// Construct using com.hedera.hashgraph.sdk.proto.TokenBalance.newBuilder()
private Builder() {
super(DEFAULT_INSTANCE);
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
@java.lang.Override
public boolean hasTokenId() {
return instance.hasTokenId();
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TokenID getTokenId() {
return instance.getTokenId();
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
public Builder setTokenId(com.hedera.hashgraph.sdk.proto.TokenID value) {
copyOnWrite();
instance.setTokenId(value);
return this;
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
public Builder setTokenId(
com.hedera.hashgraph.sdk.proto.TokenID.Builder builderForValue) {
copyOnWrite();
instance.setTokenId(builderForValue.build());
return this;
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
public Builder mergeTokenId(com.hedera.hashgraph.sdk.proto.TokenID value) {
copyOnWrite();
instance.mergeTokenId(value);
return this;
}
/**
*
**
* A unique token id
*
*
* .proto.TokenID tokenId = 1;
*/
public Builder clearTokenId() { copyOnWrite();
instance.clearTokenId();
return this;
}
/**
*
**
* Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON -
* balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of
* NFTs held by the account
*
*
* uint64 balance = 2;
* @return The balance.
*/
@java.lang.Override
public long getBalance() {
return instance.getBalance();
}
/**
*
**
* Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON -
* balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of
* NFTs held by the account
*
*
* uint64 balance = 2;
* @param value The balance to set.
* @return This builder for chaining.
*/
public Builder setBalance(long value) {
copyOnWrite();
instance.setBalance(value);
return this;
}
/**
*
**
* Number of transferable units of the identified token. For token of type FUNGIBLE_COMMON -
* balance in the smallest denomination. For token of type NON_FUNGIBLE_UNIQUE - the number of
* NFTs held by the account
*
*
* uint64 balance = 2;
* @return This builder for chaining.
*/
public Builder clearBalance() {
copyOnWrite();
instance.clearBalance();
return this;
}
/**
*
**
* Tokens divide into <tt>10<sup>decimals</sup></tt> pieces
*
*
* uint32 decimals = 3;
* @return The decimals.
*/
@java.lang.Override
public int getDecimals() {
return instance.getDecimals();
}
/**
*
**
* Tokens divide into <tt>10<sup>decimals</sup></tt> pieces
*
*
* uint32 decimals = 3;
* @param value The decimals to set.
* @return This builder for chaining.
*/
public Builder setDecimals(int value) {
copyOnWrite();
instance.setDecimals(value);
return this;
}
/**
*
**
* Tokens divide into <tt>10<sup>decimals</sup></tt> pieces
*
*
* uint32 decimals = 3;
* @return This builder for chaining.
*/
public Builder clearDecimals() {
copyOnWrite();
instance.clearDecimals();
return this;
}
// @@protoc_insertion_point(builder_scope:proto.TokenBalance)
}
@java.lang.Override
@java.lang.SuppressWarnings({"unchecked", "fallthrough"})
protected final java.lang.Object dynamicMethod(
com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
java.lang.Object arg0, java.lang.Object arg1) {
switch (method) {
case NEW_MUTABLE_INSTANCE: {
return new com.hedera.hashgraph.sdk.proto.TokenBalance();
}
case NEW_BUILDER: {
return new Builder();
}
case BUILD_MESSAGE_INFO: {
java.lang.Object[] objects = new java.lang.Object[] {
"tokenId_",
"balance_",
"decimals_",
};
java.lang.String info =
"\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\t\u0002\u0003" +
"\u0003\u000b";
return newMessageInfo(DEFAULT_INSTANCE, info, objects);
}
// fall through
case GET_DEFAULT_INSTANCE: {
return DEFAULT_INSTANCE;
}
case GET_PARSER: {
com.google.protobuf.Parser parser = PARSER;
if (parser == null) {
synchronized (com.hedera.hashgraph.sdk.proto.TokenBalance.class) {
parser = PARSER;
if (parser == null) {
parser =
new DefaultInstanceBasedParser(
DEFAULT_INSTANCE);
PARSER = parser;
}
}
}
return parser;
}
case GET_MEMOIZED_IS_INITIALIZED: {
return (byte) 1;
}
case SET_MEMOIZED_IS_INITIALIZED: {
return null;
}
}
throw new UnsupportedOperationException();
}
// @@protoc_insertion_point(class_scope:proto.TokenBalance)
private static final com.hedera.hashgraph.sdk.proto.TokenBalance DEFAULT_INSTANCE;
static {
TokenBalance defaultInstance = new TokenBalance();
// New instances are implicitly immutable so no need to make
// immutable.
DEFAULT_INSTANCE = defaultInstance;
com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
TokenBalance.class, defaultInstance);
}
public static com.hedera.hashgraph.sdk.proto.TokenBalance getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static volatile com.google.protobuf.Parser PARSER;
public static com.google.protobuf.Parser parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy