com.hedera.hashgraph.sdk.proto.ContractID Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: basic_types.proto
// Protobuf Java Version: 3.25.4
package com.hedera.hashgraph.sdk.proto;
/**
*
**
* The ID for a smart contract instance
*
*
* Protobuf type {@code proto.ContractID}
*/
public final class ContractID extends
com.google.protobuf.GeneratedMessageLite<
ContractID, ContractID.Builder> implements
// @@protoc_insertion_point(message_implements:proto.ContractID)
ContractIDOrBuilder {
private ContractID() {
}
private int contractCase_ = 0;
private java.lang.Object contract_;
public enum ContractCase {
CONTRACTNUM(3),
EVM_ADDRESS(4),
CONTRACT_NOT_SET(0);
private final int value;
private ContractCase(int value) {
this.value = value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ContractCase valueOf(int value) {
return forNumber(value);
}
public static ContractCase forNumber(int value) {
switch (value) {
case 3: return CONTRACTNUM;
case 4: return EVM_ADDRESS;
case 0: return CONTRACT_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
@java.lang.Override
public ContractCase
getContractCase() {
return ContractCase.forNumber(
contractCase_);
}
private void clearContract() {
contractCase_ = 0;
contract_ = null;
}
public static final int SHARDNUM_FIELD_NUMBER = 1;
private long shardNum_;
/**
*
**
* The shard number (nonnegative)
*
*
* int64 shardNum = 1;
* @return The shardNum.
*/
@java.lang.Override
public long getShardNum() {
return shardNum_;
}
/**
*
**
* The shard number (nonnegative)
*
*
* int64 shardNum = 1;
* @param value The shardNum to set.
*/
private void setShardNum(long value) {
shardNum_ = value;
}
/**
*
**
* The shard number (nonnegative)
*
*
* int64 shardNum = 1;
*/
private void clearShardNum() {
shardNum_ = 0L;
}
public static final int REALMNUM_FIELD_NUMBER = 2;
private long realmNum_;
/**
*
**
* The realm number (nonnegative)
*
*
* int64 realmNum = 2;
* @return The realmNum.
*/
@java.lang.Override
public long getRealmNum() {
return realmNum_;
}
/**
*
**
* The realm number (nonnegative)
*
*
* int64 realmNum = 2;
* @param value The realmNum to set.
*/
private void setRealmNum(long value) {
realmNum_ = value;
}
/**
*
**
* The realm number (nonnegative)
*
*
* int64 realmNum = 2;
*/
private void clearRealmNum() {
realmNum_ = 0L;
}
public static final int CONTRACTNUM_FIELD_NUMBER = 3;
/**
*
**
* A nonnegative number unique within a given shard and realm
*
*
* int64 contractNum = 3;
* @return Whether the contractNum field is set.
*/
@java.lang.Override
public boolean hasContractNum() {
return contractCase_ == 3;
}
/**
*
**
* A nonnegative number unique within a given shard and realm
*
*
* int64 contractNum = 3;
* @return The contractNum.
*/
@java.lang.Override
public long getContractNum() {
if (contractCase_ == 3) {
return (java.lang.Long) contract_;
}
return 0L;
}
/**
*
**
* A nonnegative number unique within a given shard and realm
*
*
* int64 contractNum = 3;
* @param value The contractNum to set.
*/
private void setContractNum(long value) {
contractCase_ = 3;
contract_ = value;
}
/**
*
**
* A nonnegative number unique within a given shard and realm
*
*
* int64 contractNum = 3;
*/
private void clearContractNum() {
if (contractCase_ == 3) {
contractCase_ = 0;
contract_ = null;
}
}
public static final int EVM_ADDRESS_FIELD_NUMBER = 4;
/**
*
**
* The 20-byte EVM address of the contract to call.
*
* Every contract has an EVM address determined by its <tt>shard.realm.num</tt> id.
* This address is as follows:
* <ol>
* <li>The first 4 bytes are the big-endian representation of the shard.</li>
* <li>The next 8 bytes are the big-endian representation of the realm.</li>
* <li>The final 8 bytes are the big-endian representation of the number.</li>
* </ol>
*
* Contracts created via CREATE2 have an <b>additional, primary address</b> that is
* derived from the <a href="https://eips.ethereum.org/EIPS/eip-1014">EIP-1014</a>
* specification, and does not have a simple relation to a <tt>shard.realm.num</tt> id.
*
* (Please do note that CREATE2 contracts can also be referenced by the three-part
* EVM address described above.)
*
*
* bytes evm_address = 4;
* @return Whether the evmAddress field is set.
*/
@java.lang.Override
public boolean hasEvmAddress() {
return contractCase_ == 4;
}
/**
*
**
* The 20-byte EVM address of the contract to call.
*
* Every contract has an EVM address determined by its <tt>shard.realm.num</tt> id.
* This address is as follows:
* <ol>
* <li>The first 4 bytes are the big-endian representation of the shard.</li>
* <li>The next 8 bytes are the big-endian representation of the realm.</li>
* <li>The final 8 bytes are the big-endian representation of the number.</li>
* </ol>
*
* Contracts created via CREATE2 have an <b>additional, primary address</b> that is
* derived from the <a href="https://eips.ethereum.org/EIPS/eip-1014">EIP-1014</a>
* specification, and does not have a simple relation to a <tt>shard.realm.num</tt> id.
*
* (Please do note that CREATE2 contracts can also be referenced by the three-part
* EVM address described above.)
*
*
* bytes evm_address = 4;
* @return The evmAddress.
*/
@java.lang.Override
public com.google.protobuf.ByteString getEvmAddress() {
if (contractCase_ == 4) {
return (com.google.protobuf.ByteString) contract_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
**
* The 20-byte EVM address of the contract to call.
*
* Every contract has an EVM address determined by its <tt>shard.realm.num</tt> id.
* This address is as follows:
* <ol>
* <li>The first 4 bytes are the big-endian representation of the shard.</li>
* <li>The next 8 bytes are the big-endian representation of the realm.</li>
* <li>The final 8 bytes are the big-endian representation of the number.</li>
* </ol>
*
* Contracts created via CREATE2 have an <b>additional, primary address</b> that is
* derived from the <a href="https://eips.ethereum.org/EIPS/eip-1014">EIP-1014</a>
* specification, and does not have a simple relation to a <tt>shard.realm.num</tt> id.
*
* (Please do note that CREATE2 contracts can also be referenced by the three-part
* EVM address described above.)
*
*
* bytes evm_address = 4;
* @param value The evmAddress to set.
*/
private void setEvmAddress(com.google.protobuf.ByteString value) {
java.lang.Class> valueClass = value.getClass();
contractCase_ = 4;
contract_ = value;
}
/**
*
**
* The 20-byte EVM address of the contract to call.
*
* Every contract has an EVM address determined by its <tt>shard.realm.num</tt> id.
* This address is as follows:
* <ol>
* <li>The first 4 bytes are the big-endian representation of the shard.</li>
* <li>The next 8 bytes are the big-endian representation of the realm.</li>
* <li>The final 8 bytes are the big-endian representation of the number.</li>
* </ol>
*
* Contracts created via CREATE2 have an <b>additional, primary address</b> that is
* derived from the <a href="https://eips.ethereum.org/EIPS/eip-1014">EIP-1014</a>
* specification, and does not have a simple relation to a <tt>shard.realm.num</tt> id.
*
* (Please do note that CREATE2 contracts can also be referenced by the three-part
* EVM address described above.)
*
*
* bytes evm_address = 4;
*/
private void clearEvmAddress() {
if (contractCase_ == 4) {
contractCase_ = 0;
contract_ = null;
}
}
public static com.hedera.hashgraph.sdk.proto.ContractID 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.ContractID 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.ContractID 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.ContractID 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.ContractID parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.hedera.hashgraph.sdk.proto.ContractID 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.ContractID 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.ContractID 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.ContractID parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input);
}
public static com.hedera.hashgraph.sdk.proto.ContractID 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.ContractID 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.ContractID 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.ContractID prototype) {
return DEFAULT_INSTANCE.createBuilder(prototype);
}
/**
*
**
* The ID for a smart contract instance
*
*
* Protobuf type {@code proto.ContractID}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageLite.Builder<
com.hedera.hashgraph.sdk.proto.ContractID, Builder> implements
// @@protoc_insertion_point(builder_implements:proto.ContractID)
com.hedera.hashgraph.sdk.proto.ContractIDOrBuilder {
// Construct using com.hedera.hashgraph.sdk.proto.ContractID.newBuilder()
private Builder() {
super(DEFAULT_INSTANCE);
}
@java.lang.Override
public ContractCase
getContractCase() {
return instance.getContractCase();
}
public Builder clearContract() {
copyOnWrite();
instance.clearContract();
return this;
}
/**
*
**
* The shard number (nonnegative)
*
*
* int64 shardNum = 1;
* @return The shardNum.
*/
@java.lang.Override
public long getShardNum() {
return instance.getShardNum();
}
/**
*
**
* The shard number (nonnegative)
*
*
* int64 shardNum = 1;
* @param value The shardNum to set.
* @return This builder for chaining.
*/
public Builder setShardNum(long value) {
copyOnWrite();
instance.setShardNum(value);
return this;
}
/**
*
**
* The shard number (nonnegative)
*
*
* int64 shardNum = 1;
* @return This builder for chaining.
*/
public Builder clearShardNum() {
copyOnWrite();
instance.clearShardNum();
return this;
}
/**
*
**
* The realm number (nonnegative)
*
*
* int64 realmNum = 2;
* @return The realmNum.
*/
@java.lang.Override
public long getRealmNum() {
return instance.getRealmNum();
}
/**
*
**
* The realm number (nonnegative)
*
*
* int64 realmNum = 2;
* @param value The realmNum to set.
* @return This builder for chaining.
*/
public Builder setRealmNum(long value) {
copyOnWrite();
instance.setRealmNum(value);
return this;
}
/**
*
**
* The realm number (nonnegative)
*
*
* int64 realmNum = 2;
* @return This builder for chaining.
*/
public Builder clearRealmNum() {
copyOnWrite();
instance.clearRealmNum();
return this;
}
/**
*
**
* A nonnegative number unique within a given shard and realm
*
*
* int64 contractNum = 3;
* @return Whether the contractNum field is set.
*/
@java.lang.Override
public boolean hasContractNum() {
return instance.hasContractNum();
}
/**
*
**
* A nonnegative number unique within a given shard and realm
*
*
* int64 contractNum = 3;
* @return The contractNum.
*/
@java.lang.Override
public long getContractNum() {
return instance.getContractNum();
}
/**
*
**
* A nonnegative number unique within a given shard and realm
*
*
* int64 contractNum = 3;
* @param value The contractNum to set.
* @return This builder for chaining.
*/
public Builder setContractNum(long value) {
copyOnWrite();
instance.setContractNum(value);
return this;
}
/**
*
**
* A nonnegative number unique within a given shard and realm
*
*
* int64 contractNum = 3;
* @return This builder for chaining.
*/
public Builder clearContractNum() {
copyOnWrite();
instance.clearContractNum();
return this;
}
/**
*
**
* The 20-byte EVM address of the contract to call.
*
* Every contract has an EVM address determined by its <tt>shard.realm.num</tt> id.
* This address is as follows:
* <ol>
* <li>The first 4 bytes are the big-endian representation of the shard.</li>
* <li>The next 8 bytes are the big-endian representation of the realm.</li>
* <li>The final 8 bytes are the big-endian representation of the number.</li>
* </ol>
*
* Contracts created via CREATE2 have an <b>additional, primary address</b> that is
* derived from the <a href="https://eips.ethereum.org/EIPS/eip-1014">EIP-1014</a>
* specification, and does not have a simple relation to a <tt>shard.realm.num</tt> id.
*
* (Please do note that CREATE2 contracts can also be referenced by the three-part
* EVM address described above.)
*
*
* bytes evm_address = 4;
* @return Whether the evmAddress field is set.
*/
@java.lang.Override
public boolean hasEvmAddress() {
return instance.hasEvmAddress();
}
/**
*
**
* The 20-byte EVM address of the contract to call.
*
* Every contract has an EVM address determined by its <tt>shard.realm.num</tt> id.
* This address is as follows:
* <ol>
* <li>The first 4 bytes are the big-endian representation of the shard.</li>
* <li>The next 8 bytes are the big-endian representation of the realm.</li>
* <li>The final 8 bytes are the big-endian representation of the number.</li>
* </ol>
*
* Contracts created via CREATE2 have an <b>additional, primary address</b> that is
* derived from the <a href="https://eips.ethereum.org/EIPS/eip-1014">EIP-1014</a>
* specification, and does not have a simple relation to a <tt>shard.realm.num</tt> id.
*
* (Please do note that CREATE2 contracts can also be referenced by the three-part
* EVM address described above.)
*
*
* bytes evm_address = 4;
* @return The evmAddress.
*/
@java.lang.Override
public com.google.protobuf.ByteString getEvmAddress() {
return instance.getEvmAddress();
}
/**
*
**
* The 20-byte EVM address of the contract to call.
*
* Every contract has an EVM address determined by its <tt>shard.realm.num</tt> id.
* This address is as follows:
* <ol>
* <li>The first 4 bytes are the big-endian representation of the shard.</li>
* <li>The next 8 bytes are the big-endian representation of the realm.</li>
* <li>The final 8 bytes are the big-endian representation of the number.</li>
* </ol>
*
* Contracts created via CREATE2 have an <b>additional, primary address</b> that is
* derived from the <a href="https://eips.ethereum.org/EIPS/eip-1014">EIP-1014</a>
* specification, and does not have a simple relation to a <tt>shard.realm.num</tt> id.
*
* (Please do note that CREATE2 contracts can also be referenced by the three-part
* EVM address described above.)
*
*
* bytes evm_address = 4;
* @param value The evmAddress to set.
* @return This builder for chaining.
*/
public Builder setEvmAddress(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setEvmAddress(value);
return this;
}
/**
*
**
* The 20-byte EVM address of the contract to call.
*
* Every contract has an EVM address determined by its <tt>shard.realm.num</tt> id.
* This address is as follows:
* <ol>
* <li>The first 4 bytes are the big-endian representation of the shard.</li>
* <li>The next 8 bytes are the big-endian representation of the realm.</li>
* <li>The final 8 bytes are the big-endian representation of the number.</li>
* </ol>
*
* Contracts created via CREATE2 have an <b>additional, primary address</b> that is
* derived from the <a href="https://eips.ethereum.org/EIPS/eip-1014">EIP-1014</a>
* specification, and does not have a simple relation to a <tt>shard.realm.num</tt> id.
*
* (Please do note that CREATE2 contracts can also be referenced by the three-part
* EVM address described above.)
*
*
* bytes evm_address = 4;
* @return This builder for chaining.
*/
public Builder clearEvmAddress() {
copyOnWrite();
instance.clearEvmAddress();
return this;
}
// @@protoc_insertion_point(builder_scope:proto.ContractID)
}
@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.ContractID();
}
case NEW_BUILDER: {
return new Builder();
}
case BUILD_MESSAGE_INFO: {
java.lang.Object[] objects = new java.lang.Object[] {
"contract_",
"contractCase_",
"shardNum_",
"realmNum_",
};
java.lang.String info =
"\u0000\u0004\u0001\u0000\u0001\u0004\u0004\u0000\u0000\u0000\u0001\u0002\u0002\u0002" +
"\u00035\u0000\u0004=\u0000";
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.ContractID.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.ContractID)
private static final com.hedera.hashgraph.sdk.proto.ContractID DEFAULT_INSTANCE;
static {
ContractID defaultInstance = new ContractID();
// New instances are implicitly immutable so no need to make
// immutable.
DEFAULT_INSTANCE = defaultInstance;
com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
ContractID.class, defaultInstance);
}
public static com.hedera.hashgraph.sdk.proto.ContractID getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static volatile com.google.protobuf.Parser PARSER;
public static com.google.protobuf.Parser parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}