com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-full Show documentation
Show all versions of sdk-full Show documentation
Hedera™ Hashgraph SDK for Java
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: token_mint.proto
// Protobuf Java Version: 3.25.3
package com.hedera.hashgraph.sdk.proto;
/**
*
**
* Mints tokens to the Token's treasury Account. If no Supply Key is defined, the transaction will
* resolve to TOKEN_HAS_NO_SUPPLY_KEY.
* The operation increases the Total Supply of the Token. The maximum total supply a token can have
* is 2^63-1.
* The amount provided must be in the lowest denomination possible. Example:
* Token A has 2 decimals. In order to mint 100 tokens, one must provide amount of 10000. In order
* to mint 100.55 tokens, one must provide amount of 10055.
* If both amount and metadata list get filled, a INVALID_TRANSACTION_BODY response code will be
* returned.
* If the metadata list contains metadata which is too large, a METADATA_TOO_LONG response code will
* be returned.
* If the metadata list is not filled for a non-fungible token type, a INVALID_TOKEN_MINT_AMOUNT response
* code will be returned.
* If a zero amount is provided for a fungible token type, it will be treated as a regular transaction.
* If the metadata list count is greater than the batch size limit global dynamic property, a
* BATCH_SIZE_LIMIT_EXCEEDED response code will be returned.
*
*
* Protobuf type {@code proto.TokenMintTransactionBody}
*/
public final class TokenMintTransactionBody extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:proto.TokenMintTransactionBody)
TokenMintTransactionBodyOrBuilder {
private static final long serialVersionUID = 0L;
// Use TokenMintTransactionBody.newBuilder() to construct.
private TokenMintTransactionBody(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TokenMintTransactionBody() {
metadata_ = emptyList(com.google.protobuf.ByteString.class);
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TokenMintTransactionBody();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.hedera.hashgraph.sdk.proto.TokenMint.internal_static_proto_TokenMintTransactionBody_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.hedera.hashgraph.sdk.proto.TokenMint.internal_static_proto_TokenMintTransactionBody_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody.class, com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody.Builder.class);
}
private int bitField0_;
public static final int TOKEN_FIELD_NUMBER = 1;
private com.hedera.hashgraph.sdk.proto.TokenID token_;
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
* @return Whether the token field is set.
*/
@java.lang.Override
public boolean hasToken() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
* @return The token.
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TokenID getToken() {
return token_ == null ? com.hedera.hashgraph.sdk.proto.TokenID.getDefaultInstance() : token_;
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
*/
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TokenIDOrBuilder getTokenOrBuilder() {
return token_ == null ? com.hedera.hashgraph.sdk.proto.TokenID.getDefaultInstance() : token_;
}
public static final int AMOUNT_FIELD_NUMBER = 2;
private long amount_ = 0L;
/**
*
**
* Applicable to tokens of type FUNGIBLE_COMMON. The amount to mint to the Treasury Account.
* Amount must be a positive non-zero number represented in the lowest denomination of the
* token. The new supply must be lower than 2^63.
*
*
* uint64 amount = 2;
* @return The amount.
*/
@java.lang.Override
public long getAmount() {
return amount_;
}
public static final int METADATA_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private com.google.protobuf.Internal.ProtobufList metadata_ =
emptyList(com.google.protobuf.ByteString.class);
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @return A list containing the metadata.
*/
@java.lang.Override
public java.util.List
getMetadataList() {
return metadata_;
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @return The count of metadata.
*/
public int getMetadataCount() {
return metadata_.size();
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @param index The index of the element to return.
* @return The metadata at the given index.
*/
public com.google.protobuf.ByteString getMetadata(int index) {
return metadata_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getToken());
}
if (amount_ != 0L) {
output.writeUInt64(2, amount_);
}
for (int i = 0; i < metadata_.size(); i++) {
output.writeBytes(3, metadata_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getToken());
}
if (amount_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeUInt64Size(2, amount_);
}
{
int dataSize = 0;
for (int i = 0; i < metadata_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(metadata_.get(i));
}
size += dataSize;
size += 1 * getMetadataList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody)) {
return super.equals(obj);
}
com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody other = (com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody) obj;
if (hasToken() != other.hasToken()) return false;
if (hasToken()) {
if (!getToken()
.equals(other.getToken())) return false;
}
if (getAmount()
!= other.getAmount()) return false;
if (!getMetadataList()
.equals(other.getMetadataList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasToken()) {
hash = (37 * hash) + TOKEN_FIELD_NUMBER;
hash = (53 * hash) + getToken().hashCode();
}
hash = (37 * hash) + AMOUNT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getAmount());
if (getMetadataCount() > 0) {
hash = (37 * hash) + METADATA_FIELD_NUMBER;
hash = (53 * hash) + getMetadataList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
**
* Mints tokens to the Token's treasury Account. If no Supply Key is defined, the transaction will
* resolve to TOKEN_HAS_NO_SUPPLY_KEY.
* The operation increases the Total Supply of the Token. The maximum total supply a token can have
* is 2^63-1.
* The amount provided must be in the lowest denomination possible. Example:
* Token A has 2 decimals. In order to mint 100 tokens, one must provide amount of 10000. In order
* to mint 100.55 tokens, one must provide amount of 10055.
* If both amount and metadata list get filled, a INVALID_TRANSACTION_BODY response code will be
* returned.
* If the metadata list contains metadata which is too large, a METADATA_TOO_LONG response code will
* be returned.
* If the metadata list is not filled for a non-fungible token type, a INVALID_TOKEN_MINT_AMOUNT response
* code will be returned.
* If a zero amount is provided for a fungible token type, it will be treated as a regular transaction.
* If the metadata list count is greater than the batch size limit global dynamic property, a
* BATCH_SIZE_LIMIT_EXCEEDED response code will be returned.
*
*
* Protobuf type {@code proto.TokenMintTransactionBody}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:proto.TokenMintTransactionBody)
com.hedera.hashgraph.sdk.proto.TokenMintTransactionBodyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.hedera.hashgraph.sdk.proto.TokenMint.internal_static_proto_TokenMintTransactionBody_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.hedera.hashgraph.sdk.proto.TokenMint.internal_static_proto_TokenMintTransactionBody_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody.class, com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody.Builder.class);
}
// Construct using com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getTokenFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
token_ = null;
if (tokenBuilder_ != null) {
tokenBuilder_.dispose();
tokenBuilder_ = null;
}
amount_ = 0L;
metadata_ = emptyList(com.google.protobuf.ByteString.class);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.hedera.hashgraph.sdk.proto.TokenMint.internal_static_proto_TokenMintTransactionBody_descriptor;
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody getDefaultInstanceForType() {
return com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody.getDefaultInstance();
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody build() {
com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody buildPartial() {
com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody result = new com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.token_ = tokenBuilder_ == null
? token_
: tokenBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.amount_ = amount_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
metadata_.makeImmutable();
result.metadata_ = metadata_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody) {
return mergeFrom((com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody other) {
if (other == com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody.getDefaultInstance()) return this;
if (other.hasToken()) {
mergeToken(other.getToken());
}
if (other.getAmount() != 0L) {
setAmount(other.getAmount());
}
if (!other.metadata_.isEmpty()) {
if (metadata_.isEmpty()) {
metadata_ = other.metadata_;
metadata_.makeImmutable();
bitField0_ |= 0x00000004;
} else {
ensureMetadataIsMutable();
metadata_.addAll(other.metadata_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getTokenFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
amount_ = input.readUInt64();
bitField0_ |= 0x00000002;
break;
} // case 16
case 26: {
com.google.protobuf.ByteString v = input.readBytes();
ensureMetadataIsMutable();
metadata_.add(v);
break;
} // case 26
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.hedera.hashgraph.sdk.proto.TokenID token_;
private com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.TokenID, com.hedera.hashgraph.sdk.proto.TokenID.Builder, com.hedera.hashgraph.sdk.proto.TokenIDOrBuilder> tokenBuilder_;
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
* @return Whether the token field is set.
*/
public boolean hasToken() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
* @return The token.
*/
public com.hedera.hashgraph.sdk.proto.TokenID getToken() {
if (tokenBuilder_ == null) {
return token_ == null ? com.hedera.hashgraph.sdk.proto.TokenID.getDefaultInstance() : token_;
} else {
return tokenBuilder_.getMessage();
}
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
*/
public Builder setToken(com.hedera.hashgraph.sdk.proto.TokenID value) {
if (tokenBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
token_ = value;
} else {
tokenBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
*/
public Builder setToken(
com.hedera.hashgraph.sdk.proto.TokenID.Builder builderForValue) {
if (tokenBuilder_ == null) {
token_ = builderForValue.build();
} else {
tokenBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
*/
public Builder mergeToken(com.hedera.hashgraph.sdk.proto.TokenID value) {
if (tokenBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
token_ != null &&
token_ != com.hedera.hashgraph.sdk.proto.TokenID.getDefaultInstance()) {
getTokenBuilder().mergeFrom(value);
} else {
token_ = value;
}
} else {
tokenBuilder_.mergeFrom(value);
}
if (token_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
*/
public Builder clearToken() {
bitField0_ = (bitField0_ & ~0x00000001);
token_ = null;
if (tokenBuilder_ != null) {
tokenBuilder_.dispose();
tokenBuilder_ = null;
}
onChanged();
return this;
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
*/
public com.hedera.hashgraph.sdk.proto.TokenID.Builder getTokenBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getTokenFieldBuilder().getBuilder();
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
*/
public com.hedera.hashgraph.sdk.proto.TokenIDOrBuilder getTokenOrBuilder() {
if (tokenBuilder_ != null) {
return tokenBuilder_.getMessageOrBuilder();
} else {
return token_ == null ?
com.hedera.hashgraph.sdk.proto.TokenID.getDefaultInstance() : token_;
}
}
/**
*
**
* The token for which to mint tokens. If token does not exist, transaction results in
* INVALID_TOKEN_ID
*
*
* .proto.TokenID token = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.TokenID, com.hedera.hashgraph.sdk.proto.TokenID.Builder, com.hedera.hashgraph.sdk.proto.TokenIDOrBuilder>
getTokenFieldBuilder() {
if (tokenBuilder_ == null) {
tokenBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.hedera.hashgraph.sdk.proto.TokenID, com.hedera.hashgraph.sdk.proto.TokenID.Builder, com.hedera.hashgraph.sdk.proto.TokenIDOrBuilder>(
getToken(),
getParentForChildren(),
isClean());
token_ = null;
}
return tokenBuilder_;
}
private long amount_ ;
/**
*
**
* Applicable to tokens of type FUNGIBLE_COMMON. The amount to mint to the Treasury Account.
* Amount must be a positive non-zero number represented in the lowest denomination of the
* token. The new supply must be lower than 2^63.
*
*
* uint64 amount = 2;
* @return The amount.
*/
@java.lang.Override
public long getAmount() {
return amount_;
}
/**
*
**
* Applicable to tokens of type FUNGIBLE_COMMON. The amount to mint to the Treasury Account.
* Amount must be a positive non-zero number represented in the lowest denomination of the
* token. The new supply must be lower than 2^63.
*
*
* uint64 amount = 2;
* @param value The amount to set.
* @return This builder for chaining.
*/
public Builder setAmount(long value) {
amount_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
**
* Applicable to tokens of type FUNGIBLE_COMMON. The amount to mint to the Treasury Account.
* Amount must be a positive non-zero number represented in the lowest denomination of the
* token. The new supply must be lower than 2^63.
*
*
* uint64 amount = 2;
* @return This builder for chaining.
*/
public Builder clearAmount() {
bitField0_ = (bitField0_ & ~0x00000002);
amount_ = 0L;
onChanged();
return this;
}
private com.google.protobuf.Internal.ProtobufList metadata_ = emptyList(com.google.protobuf.ByteString.class);
private void ensureMetadataIsMutable() {
if (!metadata_.isModifiable()) {
metadata_ = makeMutableCopy(metadata_);
}
bitField0_ |= 0x00000004;
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @return A list containing the metadata.
*/
public java.util.List
getMetadataList() {
metadata_.makeImmutable();
return metadata_;
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @return The count of metadata.
*/
public int getMetadataCount() {
return metadata_.size();
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @param index The index of the element to return.
* @return The metadata at the given index.
*/
public com.google.protobuf.ByteString getMetadata(int index) {
return metadata_.get(index);
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @param index The index to set the value at.
* @param value The metadata to set.
* @return This builder for chaining.
*/
public Builder setMetadata(
int index, com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
ensureMetadataIsMutable();
metadata_.set(index, value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @param value The metadata to add.
* @return This builder for chaining.
*/
public Builder addMetadata(com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
ensureMetadataIsMutable();
metadata_.add(value);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @param values The metadata to add.
* @return This builder for chaining.
*/
public Builder addAllMetadata(
java.lang.Iterable extends com.google.protobuf.ByteString> values) {
ensureMetadataIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, metadata_);
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
**
* Applicable to tokens of type NON_FUNGIBLE_UNIQUE. A list of metadata that are being created.
* Maximum allowed size of each metadata is 100 bytes
*
*
* repeated bytes metadata = 3;
* @return This builder for chaining.
*/
public Builder clearMetadata() {
metadata_ = emptyList(com.google.protobuf.ByteString.class);
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:proto.TokenMintTransactionBody)
}
// @@protoc_insertion_point(class_scope:proto.TokenMintTransactionBody)
private static final com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody();
}
public static com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TokenMintTransactionBody parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.hedera.hashgraph.sdk.proto.TokenMintTransactionBody getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}