Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.hedera.hapi.node.transaction;
import com.hedera.hapi.node.consensus.*;
import com.hedera.hapi.node.contract.*;
import com.hedera.hapi.node.file.*;
import com.hedera.hapi.node.network.*;
import com.hedera.hapi.node.scheduled.*;
import com.hedera.hapi.node.token.*;
import com.hedera.hapi.node.transaction.*;
import com.hedera.pbj.runtime.*;
import com.hedera.pbj.runtime.io.*;
import com.hedera.pbj.runtime.io.buffer.*;
import com.hedera.pbj.runtime.io.stream.*;
import edu.umd.cs.findbugs.annotations.*;
import com.hedera.pbj.runtime.Codec;
import java.util.function.Consumer;
import edu.umd.cs.findbugs.annotations.Nullable;
import edu.umd.cs.findbugs.annotations.NonNull;
import static java.util.Objects.requireNonNull;
/**
* A single query, which is sent from the client to a node. This includes all possible queries. Each
* Query should not have more than 50 levels.
*
* @param query (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 50, 51, 52, 53, 54, 55, 56, 57, 58)
*/
public record Query(
OneOf query
) {
/** Protobuf codec for reading and writing in protobuf format */
public static final Codec PROTOBUF = new com.hedera.hapi.node.transaction.codec.QueryProtoCodec();
/** JSON codec for reading and writing in JSON format */
public static final JsonCodec JSON = new com.hedera.hapi.node.transaction.codec.QueryJsonCodec();
/** Default instance with all fields set to default values */
public static final Query DEFAULT = newBuilder().build();
/**
* Create a pre-populated Query.
*
* @param query (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 50, 51, 52, 53, 54, 55, 56, 57, 58)
*/
public Query(OneOf query) {
if (query == null) {
throw new NullPointerException("Parameter 'query' must be supplied and can not be null");
}
this.query = query;
}
/**
* Override the default hashCode method for
* all other objects to make hashCode
*/
@Override
public int hashCode() {
int result = 1;
if (query != null && !query.equals(DEFAULT.query)) {
result = 31 * result + query.hashCode();
}
long hashCode = result;
// Shifts: 30, 27, 16, 20, 5, 18, 10, 24, 30
hashCode += hashCode << 30;
hashCode ^= hashCode >>> 27;
hashCode += hashCode << 16;
hashCode ^= hashCode >>> 20;
hashCode += hashCode << 5;
hashCode ^= hashCode >>> 18;
hashCode += hashCode << 10;
hashCode ^= hashCode >>> 24;
hashCode += hashCode << 30;
return (int)hashCode;
}
/**
* Override the default equals method for
*/
@Override
public boolean equals(Object that) {
if (that == null || this.getClass() != that.getClass()) {
return false;
}
Query thatObj = (Query)that;
if (query == null && thatObj.query != null) {
return false;
}
if (query != null && !query.equals(thatObj.query)) {
return false;
}
return true;
}
/**
* Direct typed getter for one of field getByKey.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable GetByKeyQuery getByKey() {
return query.kind() == QueryOneOfType.GET_BY_KEY ? (GetByKeyQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type GET_BY_KEY
*
* @return true of the one of kind is GET_BY_KEY
*/
public boolean hasGetByKey() {
return query.kind() == QueryOneOfType.GET_BY_KEY;
}
/**
* Gets the value for getByKey if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if getByKey is null
* @return the value for getByKey if it has a value, or else returns the default value
*/
public GetByKeyQuery getByKeyOrElse(@NonNull final GetByKeyQuery defaultValue) {
return hasGetByKey() ? getByKey() : defaultValue;
}
/**
* Gets the value for getByKey if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for getByKey if it has a value
* @throws NullPointerException if getByKey is null
*/
public @NonNull GetByKeyQuery getByKeyOrThrow() {
return requireNonNull(getByKey(), "Field getByKey is null");
}
/**
* Direct typed getter for one of field getBySolidityID.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable GetBySolidityIDQuery getBySolidityID() {
return query.kind() == QueryOneOfType.GET_BY_SOLIDITY_ID ? (GetBySolidityIDQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type GET_BY_SOLIDITY_ID
*
* @return true of the one of kind is GET_BY_SOLIDITY_ID
*/
public boolean hasGetBySolidityID() {
return query.kind() == QueryOneOfType.GET_BY_SOLIDITY_ID;
}
/**
* Gets the value for getBySolidityID if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if getBySolidityID is null
* @return the value for getBySolidityID if it has a value, or else returns the default value
*/
public GetBySolidityIDQuery getBySolidityIDOrElse(@NonNull final GetBySolidityIDQuery defaultValue) {
return hasGetBySolidityID() ? getBySolidityID() : defaultValue;
}
/**
* Gets the value for getBySolidityID if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for getBySolidityID if it has a value
* @throws NullPointerException if getBySolidityID is null
*/
public @NonNull GetBySolidityIDQuery getBySolidityIDOrThrow() {
return requireNonNull(getBySolidityID(), "Field getBySolidityID is null");
}
/**
* Direct typed getter for one of field contractCallLocal.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable ContractCallLocalQuery contractCallLocal() {
return query.kind() == QueryOneOfType.CONTRACT_CALL_LOCAL ? (ContractCallLocalQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CONTRACT_CALL_LOCAL
*
* @return true of the one of kind is CONTRACT_CALL_LOCAL
*/
public boolean hasContractCallLocal() {
return query.kind() == QueryOneOfType.CONTRACT_CALL_LOCAL;
}
/**
* Gets the value for contractCallLocal if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if contractCallLocal is null
* @return the value for contractCallLocal if it has a value, or else returns the default value
*/
public ContractCallLocalQuery contractCallLocalOrElse(@NonNull final ContractCallLocalQuery defaultValue) {
return hasContractCallLocal() ? contractCallLocal() : defaultValue;
}
/**
* Gets the value for contractCallLocal if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for contractCallLocal if it has a value
* @throws NullPointerException if contractCallLocal is null
*/
public @NonNull ContractCallLocalQuery contractCallLocalOrThrow() {
return requireNonNull(contractCallLocal(), "Field contractCallLocal is null");
}
/**
* Direct typed getter for one of field contractGetInfo.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable ContractGetInfoQuery contractGetInfo() {
return query.kind() == QueryOneOfType.CONTRACT_GET_INFO ? (ContractGetInfoQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CONTRACT_GET_INFO
*
* @return true of the one of kind is CONTRACT_GET_INFO
*/
public boolean hasContractGetInfo() {
return query.kind() == QueryOneOfType.CONTRACT_GET_INFO;
}
/**
* Gets the value for contractGetInfo if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if contractGetInfo is null
* @return the value for contractGetInfo if it has a value, or else returns the default value
*/
public ContractGetInfoQuery contractGetInfoOrElse(@NonNull final ContractGetInfoQuery defaultValue) {
return hasContractGetInfo() ? contractGetInfo() : defaultValue;
}
/**
* Gets the value for contractGetInfo if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for contractGetInfo if it has a value
* @throws NullPointerException if contractGetInfo is null
*/
public @NonNull ContractGetInfoQuery contractGetInfoOrThrow() {
return requireNonNull(contractGetInfo(), "Field contractGetInfo is null");
}
/**
* Direct typed getter for one of field contractGetBytecode.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable ContractGetBytecodeQuery contractGetBytecode() {
return query.kind() == QueryOneOfType.CONTRACT_GET_BYTECODE ? (ContractGetBytecodeQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CONTRACT_GET_BYTECODE
*
* @return true of the one of kind is CONTRACT_GET_BYTECODE
*/
public boolean hasContractGetBytecode() {
return query.kind() == QueryOneOfType.CONTRACT_GET_BYTECODE;
}
/**
* Gets the value for contractGetBytecode if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if contractGetBytecode is null
* @return the value for contractGetBytecode if it has a value, or else returns the default value
*/
public ContractGetBytecodeQuery contractGetBytecodeOrElse(@NonNull final ContractGetBytecodeQuery defaultValue) {
return hasContractGetBytecode() ? contractGetBytecode() : defaultValue;
}
/**
* Gets the value for contractGetBytecode if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for contractGetBytecode if it has a value
* @throws NullPointerException if contractGetBytecode is null
*/
public @NonNull ContractGetBytecodeQuery contractGetBytecodeOrThrow() {
return requireNonNull(contractGetBytecode(), "Field contractGetBytecode is null");
}
/**
* Direct typed getter for one of field contractGetRecords.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable ContractGetRecordsQuery contractGetRecords() {
return query.kind() == QueryOneOfType.CONTRACT_GET_RECORDS ? (ContractGetRecordsQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CONTRACT_GET_RECORDS
*
* @return true of the one of kind is CONTRACT_GET_RECORDS
*/
public boolean hasContractGetRecords() {
return query.kind() == QueryOneOfType.CONTRACT_GET_RECORDS;
}
/**
* Gets the value for contractGetRecords if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if contractGetRecords is null
* @return the value for contractGetRecords if it has a value, or else returns the default value
*/
public ContractGetRecordsQuery contractGetRecordsOrElse(@NonNull final ContractGetRecordsQuery defaultValue) {
return hasContractGetRecords() ? contractGetRecords() : defaultValue;
}
/**
* Gets the value for contractGetRecords if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for contractGetRecords if it has a value
* @throws NullPointerException if contractGetRecords is null
*/
public @NonNull ContractGetRecordsQuery contractGetRecordsOrThrow() {
return requireNonNull(contractGetRecords(), "Field contractGetRecords is null");
}
/**
* Direct typed getter for one of field cryptogetAccountBalance.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable CryptoGetAccountBalanceQuery cryptogetAccountBalance() {
return query.kind() == QueryOneOfType.CRYPTOGET_ACCOUNT_BALANCE ? (CryptoGetAccountBalanceQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CRYPTOGET_ACCOUNT_BALANCE
*
* @return true of the one of kind is CRYPTOGET_ACCOUNT_BALANCE
*/
public boolean hasCryptogetAccountBalance() {
return query.kind() == QueryOneOfType.CRYPTOGET_ACCOUNT_BALANCE;
}
/**
* Gets the value for cryptogetAccountBalance if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if cryptogetAccountBalance is null
* @return the value for cryptogetAccountBalance if it has a value, or else returns the default value
*/
public CryptoGetAccountBalanceQuery cryptogetAccountBalanceOrElse(@NonNull final CryptoGetAccountBalanceQuery defaultValue) {
return hasCryptogetAccountBalance() ? cryptogetAccountBalance() : defaultValue;
}
/**
* Gets the value for cryptogetAccountBalance if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for cryptogetAccountBalance if it has a value
* @throws NullPointerException if cryptogetAccountBalance is null
*/
public @NonNull CryptoGetAccountBalanceQuery cryptogetAccountBalanceOrThrow() {
return requireNonNull(cryptogetAccountBalance(), "Field cryptogetAccountBalance is null");
}
/**
* Direct typed getter for one of field cryptoGetAccountRecords.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable CryptoGetAccountRecordsQuery cryptoGetAccountRecords() {
return query.kind() == QueryOneOfType.CRYPTO_GET_ACCOUNT_RECORDS ? (CryptoGetAccountRecordsQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CRYPTO_GET_ACCOUNT_RECORDS
*
* @return true of the one of kind is CRYPTO_GET_ACCOUNT_RECORDS
*/
public boolean hasCryptoGetAccountRecords() {
return query.kind() == QueryOneOfType.CRYPTO_GET_ACCOUNT_RECORDS;
}
/**
* Gets the value for cryptoGetAccountRecords if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if cryptoGetAccountRecords is null
* @return the value for cryptoGetAccountRecords if it has a value, or else returns the default value
*/
public CryptoGetAccountRecordsQuery cryptoGetAccountRecordsOrElse(@NonNull final CryptoGetAccountRecordsQuery defaultValue) {
return hasCryptoGetAccountRecords() ? cryptoGetAccountRecords() : defaultValue;
}
/**
* Gets the value for cryptoGetAccountRecords if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for cryptoGetAccountRecords if it has a value
* @throws NullPointerException if cryptoGetAccountRecords is null
*/
public @NonNull CryptoGetAccountRecordsQuery cryptoGetAccountRecordsOrThrow() {
return requireNonNull(cryptoGetAccountRecords(), "Field cryptoGetAccountRecords is null");
}
/**
* Direct typed getter for one of field cryptoGetInfo.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable CryptoGetInfoQuery cryptoGetInfo() {
return query.kind() == QueryOneOfType.CRYPTO_GET_INFO ? (CryptoGetInfoQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CRYPTO_GET_INFO
*
* @return true of the one of kind is CRYPTO_GET_INFO
*/
public boolean hasCryptoGetInfo() {
return query.kind() == QueryOneOfType.CRYPTO_GET_INFO;
}
/**
* Gets the value for cryptoGetInfo if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if cryptoGetInfo is null
* @return the value for cryptoGetInfo if it has a value, or else returns the default value
*/
public CryptoGetInfoQuery cryptoGetInfoOrElse(@NonNull final CryptoGetInfoQuery defaultValue) {
return hasCryptoGetInfo() ? cryptoGetInfo() : defaultValue;
}
/**
* Gets the value for cryptoGetInfo if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for cryptoGetInfo if it has a value
* @throws NullPointerException if cryptoGetInfo is null
*/
public @NonNull CryptoGetInfoQuery cryptoGetInfoOrThrow() {
return requireNonNull(cryptoGetInfo(), "Field cryptoGetInfo is null");
}
/**
* Direct typed getter for one of field cryptoGetLiveHash.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable CryptoGetLiveHashQuery cryptoGetLiveHash() {
return query.kind() == QueryOneOfType.CRYPTO_GET_LIVE_HASH ? (CryptoGetLiveHashQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CRYPTO_GET_LIVE_HASH
*
* @return true of the one of kind is CRYPTO_GET_LIVE_HASH
*/
public boolean hasCryptoGetLiveHash() {
return query.kind() == QueryOneOfType.CRYPTO_GET_LIVE_HASH;
}
/**
* Gets the value for cryptoGetLiveHash if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if cryptoGetLiveHash is null
* @return the value for cryptoGetLiveHash if it has a value, or else returns the default value
*/
public CryptoGetLiveHashQuery cryptoGetLiveHashOrElse(@NonNull final CryptoGetLiveHashQuery defaultValue) {
return hasCryptoGetLiveHash() ? cryptoGetLiveHash() : defaultValue;
}
/**
* Gets the value for cryptoGetLiveHash if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for cryptoGetLiveHash if it has a value
* @throws NullPointerException if cryptoGetLiveHash is null
*/
public @NonNull CryptoGetLiveHashQuery cryptoGetLiveHashOrThrow() {
return requireNonNull(cryptoGetLiveHash(), "Field cryptoGetLiveHash is null");
}
/**
* Direct typed getter for one of field cryptoGetProxyStakers.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable CryptoGetStakersQuery cryptoGetProxyStakers() {
return query.kind() == QueryOneOfType.CRYPTO_GET_PROXY_STAKERS ? (CryptoGetStakersQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CRYPTO_GET_PROXY_STAKERS
*
* @return true of the one of kind is CRYPTO_GET_PROXY_STAKERS
*/
public boolean hasCryptoGetProxyStakers() {
return query.kind() == QueryOneOfType.CRYPTO_GET_PROXY_STAKERS;
}
/**
* Gets the value for cryptoGetProxyStakers if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if cryptoGetProxyStakers is null
* @return the value for cryptoGetProxyStakers if it has a value, or else returns the default value
*/
public CryptoGetStakersQuery cryptoGetProxyStakersOrElse(@NonNull final CryptoGetStakersQuery defaultValue) {
return hasCryptoGetProxyStakers() ? cryptoGetProxyStakers() : defaultValue;
}
/**
* Gets the value for cryptoGetProxyStakers if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for cryptoGetProxyStakers if it has a value
* @throws NullPointerException if cryptoGetProxyStakers is null
*/
public @NonNull CryptoGetStakersQuery cryptoGetProxyStakersOrThrow() {
return requireNonNull(cryptoGetProxyStakers(), "Field cryptoGetProxyStakers is null");
}
/**
* Direct typed getter for one of field fileGetContents.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable FileGetContentsQuery fileGetContents() {
return query.kind() == QueryOneOfType.FILE_GET_CONTENTS ? (FileGetContentsQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type FILE_GET_CONTENTS
*
* @return true of the one of kind is FILE_GET_CONTENTS
*/
public boolean hasFileGetContents() {
return query.kind() == QueryOneOfType.FILE_GET_CONTENTS;
}
/**
* Gets the value for fileGetContents if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if fileGetContents is null
* @return the value for fileGetContents if it has a value, or else returns the default value
*/
public FileGetContentsQuery fileGetContentsOrElse(@NonNull final FileGetContentsQuery defaultValue) {
return hasFileGetContents() ? fileGetContents() : defaultValue;
}
/**
* Gets the value for fileGetContents if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for fileGetContents if it has a value
* @throws NullPointerException if fileGetContents is null
*/
public @NonNull FileGetContentsQuery fileGetContentsOrThrow() {
return requireNonNull(fileGetContents(), "Field fileGetContents is null");
}
/**
* Direct typed getter for one of field fileGetInfo.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable FileGetInfoQuery fileGetInfo() {
return query.kind() == QueryOneOfType.FILE_GET_INFO ? (FileGetInfoQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type FILE_GET_INFO
*
* @return true of the one of kind is FILE_GET_INFO
*/
public boolean hasFileGetInfo() {
return query.kind() == QueryOneOfType.FILE_GET_INFO;
}
/**
* Gets the value for fileGetInfo if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if fileGetInfo is null
* @return the value for fileGetInfo if it has a value, or else returns the default value
*/
public FileGetInfoQuery fileGetInfoOrElse(@NonNull final FileGetInfoQuery defaultValue) {
return hasFileGetInfo() ? fileGetInfo() : defaultValue;
}
/**
* Gets the value for fileGetInfo if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for fileGetInfo if it has a value
* @throws NullPointerException if fileGetInfo is null
*/
public @NonNull FileGetInfoQuery fileGetInfoOrThrow() {
return requireNonNull(fileGetInfo(), "Field fileGetInfo is null");
}
/**
* Direct typed getter for one of field transactionGetReceipt.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable TransactionGetReceiptQuery transactionGetReceipt() {
return query.kind() == QueryOneOfType.TRANSACTION_GET_RECEIPT ? (TransactionGetReceiptQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type TRANSACTION_GET_RECEIPT
*
* @return true of the one of kind is TRANSACTION_GET_RECEIPT
*/
public boolean hasTransactionGetReceipt() {
return query.kind() == QueryOneOfType.TRANSACTION_GET_RECEIPT;
}
/**
* Gets the value for transactionGetReceipt if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if transactionGetReceipt is null
* @return the value for transactionGetReceipt if it has a value, or else returns the default value
*/
public TransactionGetReceiptQuery transactionGetReceiptOrElse(@NonNull final TransactionGetReceiptQuery defaultValue) {
return hasTransactionGetReceipt() ? transactionGetReceipt() : defaultValue;
}
/**
* Gets the value for transactionGetReceipt if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for transactionGetReceipt if it has a value
* @throws NullPointerException if transactionGetReceipt is null
*/
public @NonNull TransactionGetReceiptQuery transactionGetReceiptOrThrow() {
return requireNonNull(transactionGetReceipt(), "Field transactionGetReceipt is null");
}
/**
* Direct typed getter for one of field transactionGetRecord.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable TransactionGetRecordQuery transactionGetRecord() {
return query.kind() == QueryOneOfType.TRANSACTION_GET_RECORD ? (TransactionGetRecordQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type TRANSACTION_GET_RECORD
*
* @return true of the one of kind is TRANSACTION_GET_RECORD
*/
public boolean hasTransactionGetRecord() {
return query.kind() == QueryOneOfType.TRANSACTION_GET_RECORD;
}
/**
* Gets the value for transactionGetRecord if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if transactionGetRecord is null
* @return the value for transactionGetRecord if it has a value, or else returns the default value
*/
public TransactionGetRecordQuery transactionGetRecordOrElse(@NonNull final TransactionGetRecordQuery defaultValue) {
return hasTransactionGetRecord() ? transactionGetRecord() : defaultValue;
}
/**
* Gets the value for transactionGetRecord if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for transactionGetRecord if it has a value
* @throws NullPointerException if transactionGetRecord is null
*/
public @NonNull TransactionGetRecordQuery transactionGetRecordOrThrow() {
return requireNonNull(transactionGetRecord(), "Field transactionGetRecord is null");
}
/**
* Direct typed getter for one of field transactionGetFastRecord.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable TransactionGetFastRecordQuery transactionGetFastRecord() {
return query.kind() == QueryOneOfType.TRANSACTION_GET_FAST_RECORD ? (TransactionGetFastRecordQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type TRANSACTION_GET_FAST_RECORD
*
* @return true of the one of kind is TRANSACTION_GET_FAST_RECORD
*/
public boolean hasTransactionGetFastRecord() {
return query.kind() == QueryOneOfType.TRANSACTION_GET_FAST_RECORD;
}
/**
* Gets the value for transactionGetFastRecord if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if transactionGetFastRecord is null
* @return the value for transactionGetFastRecord if it has a value, or else returns the default value
*/
public TransactionGetFastRecordQuery transactionGetFastRecordOrElse(@NonNull final TransactionGetFastRecordQuery defaultValue) {
return hasTransactionGetFastRecord() ? transactionGetFastRecord() : defaultValue;
}
/**
* Gets the value for transactionGetFastRecord if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for transactionGetFastRecord if it has a value
* @throws NullPointerException if transactionGetFastRecord is null
*/
public @NonNull TransactionGetFastRecordQuery transactionGetFastRecordOrThrow() {
return requireNonNull(transactionGetFastRecord(), "Field transactionGetFastRecord is null");
}
/**
* Direct typed getter for one of field consensusGetTopicInfo.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable ConsensusGetTopicInfoQuery consensusGetTopicInfo() {
return query.kind() == QueryOneOfType.CONSENSUS_GET_TOPIC_INFO ? (ConsensusGetTopicInfoQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type CONSENSUS_GET_TOPIC_INFO
*
* @return true of the one of kind is CONSENSUS_GET_TOPIC_INFO
*/
public boolean hasConsensusGetTopicInfo() {
return query.kind() == QueryOneOfType.CONSENSUS_GET_TOPIC_INFO;
}
/**
* Gets the value for consensusGetTopicInfo if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if consensusGetTopicInfo is null
* @return the value for consensusGetTopicInfo if it has a value, or else returns the default value
*/
public ConsensusGetTopicInfoQuery consensusGetTopicInfoOrElse(@NonNull final ConsensusGetTopicInfoQuery defaultValue) {
return hasConsensusGetTopicInfo() ? consensusGetTopicInfo() : defaultValue;
}
/**
* Gets the value for consensusGetTopicInfo if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for consensusGetTopicInfo if it has a value
* @throws NullPointerException if consensusGetTopicInfo is null
*/
public @NonNull ConsensusGetTopicInfoQuery consensusGetTopicInfoOrThrow() {
return requireNonNull(consensusGetTopicInfo(), "Field consensusGetTopicInfo is null");
}
/**
* Direct typed getter for one of field networkGetVersionInfo.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable NetworkGetVersionInfoQuery networkGetVersionInfo() {
return query.kind() == QueryOneOfType.NETWORK_GET_VERSION_INFO ? (NetworkGetVersionInfoQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type NETWORK_GET_VERSION_INFO
*
* @return true of the one of kind is NETWORK_GET_VERSION_INFO
*/
public boolean hasNetworkGetVersionInfo() {
return query.kind() == QueryOneOfType.NETWORK_GET_VERSION_INFO;
}
/**
* Gets the value for networkGetVersionInfo if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if networkGetVersionInfo is null
* @return the value for networkGetVersionInfo if it has a value, or else returns the default value
*/
public NetworkGetVersionInfoQuery networkGetVersionInfoOrElse(@NonNull final NetworkGetVersionInfoQuery defaultValue) {
return hasNetworkGetVersionInfo() ? networkGetVersionInfo() : defaultValue;
}
/**
* Gets the value for networkGetVersionInfo if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for networkGetVersionInfo if it has a value
* @throws NullPointerException if networkGetVersionInfo is null
*/
public @NonNull NetworkGetVersionInfoQuery networkGetVersionInfoOrThrow() {
return requireNonNull(networkGetVersionInfo(), "Field networkGetVersionInfo is null");
}
/**
* Direct typed getter for one of field tokenGetInfo.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable TokenGetInfoQuery tokenGetInfo() {
return query.kind() == QueryOneOfType.TOKEN_GET_INFO ? (TokenGetInfoQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type TOKEN_GET_INFO
*
* @return true of the one of kind is TOKEN_GET_INFO
*/
public boolean hasTokenGetInfo() {
return query.kind() == QueryOneOfType.TOKEN_GET_INFO;
}
/**
* Gets the value for tokenGetInfo if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if tokenGetInfo is null
* @return the value for tokenGetInfo if it has a value, or else returns the default value
*/
public TokenGetInfoQuery tokenGetInfoOrElse(@NonNull final TokenGetInfoQuery defaultValue) {
return hasTokenGetInfo() ? tokenGetInfo() : defaultValue;
}
/**
* Gets the value for tokenGetInfo if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for tokenGetInfo if it has a value
* @throws NullPointerException if tokenGetInfo is null
*/
public @NonNull TokenGetInfoQuery tokenGetInfoOrThrow() {
return requireNonNull(tokenGetInfo(), "Field tokenGetInfo is null");
}
/**
* Direct typed getter for one of field scheduleGetInfo.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable ScheduleGetInfoQuery scheduleGetInfo() {
return query.kind() == QueryOneOfType.SCHEDULE_GET_INFO ? (ScheduleGetInfoQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type SCHEDULE_GET_INFO
*
* @return true of the one of kind is SCHEDULE_GET_INFO
*/
public boolean hasScheduleGetInfo() {
return query.kind() == QueryOneOfType.SCHEDULE_GET_INFO;
}
/**
* Gets the value for scheduleGetInfo if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if scheduleGetInfo is null
* @return the value for scheduleGetInfo if it has a value, or else returns the default value
*/
public ScheduleGetInfoQuery scheduleGetInfoOrElse(@NonNull final ScheduleGetInfoQuery defaultValue) {
return hasScheduleGetInfo() ? scheduleGetInfo() : defaultValue;
}
/**
* Gets the value for scheduleGetInfo if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for scheduleGetInfo if it has a value
* @throws NullPointerException if scheduleGetInfo is null
*/
public @NonNull ScheduleGetInfoQuery scheduleGetInfoOrThrow() {
return requireNonNull(scheduleGetInfo(), "Field scheduleGetInfo is null");
}
/**
* Direct typed getter for one of field tokenGetAccountNftInfos.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable TokenGetAccountNftInfosQuery tokenGetAccountNftInfos() {
return query.kind() == QueryOneOfType.TOKEN_GET_ACCOUNT_NFT_INFOS ? (TokenGetAccountNftInfosQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type TOKEN_GET_ACCOUNT_NFT_INFOS
*
* @return true of the one of kind is TOKEN_GET_ACCOUNT_NFT_INFOS
*/
public boolean hasTokenGetAccountNftInfos() {
return query.kind() == QueryOneOfType.TOKEN_GET_ACCOUNT_NFT_INFOS;
}
/**
* Gets the value for tokenGetAccountNftInfos if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if tokenGetAccountNftInfos is null
* @return the value for tokenGetAccountNftInfos if it has a value, or else returns the default value
*/
public TokenGetAccountNftInfosQuery tokenGetAccountNftInfosOrElse(@NonNull final TokenGetAccountNftInfosQuery defaultValue) {
return hasTokenGetAccountNftInfos() ? tokenGetAccountNftInfos() : defaultValue;
}
/**
* Gets the value for tokenGetAccountNftInfos if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for tokenGetAccountNftInfos if it has a value
* @throws NullPointerException if tokenGetAccountNftInfos is null
*/
public @NonNull TokenGetAccountNftInfosQuery tokenGetAccountNftInfosOrThrow() {
return requireNonNull(tokenGetAccountNftInfos(), "Field tokenGetAccountNftInfos is null");
}
/**
* Direct typed getter for one of field tokenGetNftInfo.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable TokenGetNftInfoQuery tokenGetNftInfo() {
return query.kind() == QueryOneOfType.TOKEN_GET_NFT_INFO ? (TokenGetNftInfoQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type TOKEN_GET_NFT_INFO
*
* @return true of the one of kind is TOKEN_GET_NFT_INFO
*/
public boolean hasTokenGetNftInfo() {
return query.kind() == QueryOneOfType.TOKEN_GET_NFT_INFO;
}
/**
* Gets the value for tokenGetNftInfo if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if tokenGetNftInfo is null
* @return the value for tokenGetNftInfo if it has a value, or else returns the default value
*/
public TokenGetNftInfoQuery tokenGetNftInfoOrElse(@NonNull final TokenGetNftInfoQuery defaultValue) {
return hasTokenGetNftInfo() ? tokenGetNftInfo() : defaultValue;
}
/**
* Gets the value for tokenGetNftInfo if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for tokenGetNftInfo if it has a value
* @throws NullPointerException if tokenGetNftInfo is null
*/
public @NonNull TokenGetNftInfoQuery tokenGetNftInfoOrThrow() {
return requireNonNull(tokenGetNftInfo(), "Field tokenGetNftInfo is null");
}
/**
* Direct typed getter for one of field tokenGetNftInfos.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable TokenGetNftInfosQuery tokenGetNftInfos() {
return query.kind() == QueryOneOfType.TOKEN_GET_NFT_INFOS ? (TokenGetNftInfosQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type TOKEN_GET_NFT_INFOS
*
* @return true of the one of kind is TOKEN_GET_NFT_INFOS
*/
public boolean hasTokenGetNftInfos() {
return query.kind() == QueryOneOfType.TOKEN_GET_NFT_INFOS;
}
/**
* Gets the value for tokenGetNftInfos if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if tokenGetNftInfos is null
* @return the value for tokenGetNftInfos if it has a value, or else returns the default value
*/
public TokenGetNftInfosQuery tokenGetNftInfosOrElse(@NonNull final TokenGetNftInfosQuery defaultValue) {
return hasTokenGetNftInfos() ? tokenGetNftInfos() : defaultValue;
}
/**
* Gets the value for tokenGetNftInfos if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for tokenGetNftInfos if it has a value
* @throws NullPointerException if tokenGetNftInfos is null
*/
public @NonNull TokenGetNftInfosQuery tokenGetNftInfosOrThrow() {
return requireNonNull(tokenGetNftInfos(), "Field tokenGetNftInfos is null");
}
/**
* Direct typed getter for one of field networkGetExecutionTime.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable NetworkGetExecutionTimeQuery networkGetExecutionTime() {
return query.kind() == QueryOneOfType.NETWORK_GET_EXECUTION_TIME ? (NetworkGetExecutionTimeQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type NETWORK_GET_EXECUTION_TIME
*
* @return true of the one of kind is NETWORK_GET_EXECUTION_TIME
*/
public boolean hasNetworkGetExecutionTime() {
return query.kind() == QueryOneOfType.NETWORK_GET_EXECUTION_TIME;
}
/**
* Gets the value for networkGetExecutionTime if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if networkGetExecutionTime is null
* @return the value for networkGetExecutionTime if it has a value, or else returns the default value
*/
public NetworkGetExecutionTimeQuery networkGetExecutionTimeOrElse(@NonNull final NetworkGetExecutionTimeQuery defaultValue) {
return hasNetworkGetExecutionTime() ? networkGetExecutionTime() : defaultValue;
}
/**
* Gets the value for networkGetExecutionTime if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for networkGetExecutionTime if it has a value
* @throws NullPointerException if networkGetExecutionTime is null
*/
public @NonNull NetworkGetExecutionTimeQuery networkGetExecutionTimeOrThrow() {
return requireNonNull(networkGetExecutionTime(), "Field networkGetExecutionTime is null");
}
/**
* Direct typed getter for one of field accountDetails.
*
* @return one of value or null if one of is not set or a different one of value
*/
public @Nullable GetAccountDetailsQuery accountDetails() {
return query.kind() == QueryOneOfType.ACCOUNT_DETAILS ? (GetAccountDetailsQuery)query.value() : null;
}
/**
* Convenience method to check if the query has a one-of with type ACCOUNT_DETAILS
*
* @return true of the one of kind is ACCOUNT_DETAILS
*/
public boolean hasAccountDetails() {
return query.kind() == QueryOneOfType.ACCOUNT_DETAILS;
}
/**
* Gets the value for accountDetails if it has a value, or else returns the default
* value for the type.
*
* @param defaultValue the default value to return if accountDetails is null
* @return the value for accountDetails if it has a value, or else returns the default value
*/
public GetAccountDetailsQuery accountDetailsOrElse(@NonNull final GetAccountDetailsQuery defaultValue) {
return hasAccountDetails() ? accountDetails() : defaultValue;
}
/**
* Gets the value for accountDetails if it was set, or throws a NullPointerException if it was not set.
*
* @return the value for accountDetails if it has a value
* @throws NullPointerException if accountDetails is null
*/
public @NonNull GetAccountDetailsQuery accountDetailsOrThrow() {
return requireNonNull(accountDetails(), "Field accountDetails is null");
}
/**
* Return a builder for building a copy of this model object. It will be pre-populated with all the data from this
* model object.
*
* @return a pre-populated builder
*/
public Builder copyBuilder() {
return new Builder(query);
}
/**
* Return a new builder for building a model object. This is just a shortcut for new Model.Builder().
*
* @return a new builder
*/
public static Builder newBuilder() {
return new Builder();
}
/**
* Builder class for easy creation, ideal for clean code where performance is not critical. In critical performance
* paths use the constructor directly.
*/
public static final class Builder {
private OneOf query = com.hedera.hapi.node.transaction.codec.QueryProtoCodec.QUERY_UNSET;
/**
* Create an empty builder
*/
public Builder() {}
/**
* Create a pre-populated Builder.
*
* @param query (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 50, 51, 52, 53, 54, 55, 56, 57, 58)
*/
public Builder(OneOf query) {
this.query = query;
}
/**
* Build a new model record with data set on builder
*
* @return new model record with data set
*/
public Query build() {
return new Query(query);
}
/**
* (1) Get all entities associated with a given key
*
* @param getByKey value to set
* @return builder to continue building with
*/
public Builder getByKey(@Nullable GetByKeyQuery getByKey) {
this.query = new OneOf<>(Query.QueryOneOfType.GET_BY_KEY,getByKey);
return this;
}
/**
* (1) Get all entities associated with a given key
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder getByKey(GetByKeyQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.GET_BY_KEY, builder.build() );
return this;
}
/**
* (2) Get the IDs in the format used in transactions, given the format used in Solidity
*
* @param getBySolidityID value to set
* @return builder to continue building with
*/
public Builder getBySolidityID(@Nullable GetBySolidityIDQuery getBySolidityID) {
this.query = new OneOf<>(Query.QueryOneOfType.GET_BY_SOLIDITY_ID,getBySolidityID);
return this;
}
/**
* (2) Get the IDs in the format used in transactions, given the format used in Solidity
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder getBySolidityID(GetBySolidityIDQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.GET_BY_SOLIDITY_ID, builder.build() );
return this;
}
/**
* (3) Call a function of a smart contract instance
*
* @param contractCallLocal value to set
* @return builder to continue building with
*/
public Builder contractCallLocal(@Nullable ContractCallLocalQuery contractCallLocal) {
this.query = new OneOf<>(Query.QueryOneOfType.CONTRACT_CALL_LOCAL,contractCallLocal);
return this;
}
/**
* (3) Call a function of a smart contract instance
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder contractCallLocal(ContractCallLocalQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CONTRACT_CALL_LOCAL, builder.build() );
return this;
}
/**
* (4) Get information about a smart contract instance
*
* @param contractGetInfo value to set
* @return builder to continue building with
*/
public Builder contractGetInfo(@Nullable ContractGetInfoQuery contractGetInfo) {
this.query = new OneOf<>(Query.QueryOneOfType.CONTRACT_GET_INFO,contractGetInfo);
return this;
}
/**
* (4) Get information about a smart contract instance
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder contractGetInfo(ContractGetInfoQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CONTRACT_GET_INFO, builder.build() );
return this;
}
/**
* (5) Get runtime code used by a smart contract instance
*
* @param contractGetBytecode value to set
* @return builder to continue building with
*/
public Builder contractGetBytecode(@Nullable ContractGetBytecodeQuery contractGetBytecode) {
this.query = new OneOf<>(Query.QueryOneOfType.CONTRACT_GET_BYTECODE,contractGetBytecode);
return this;
}
/**
* (5) Get runtime code used by a smart contract instance
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder contractGetBytecode(ContractGetBytecodeQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CONTRACT_GET_BYTECODE, builder.build() );
return this;
}
/**
* (6) Get Records of the contract instance
*
* @param contractGetRecords value to set
* @return builder to continue building with
*/
public Builder contractGetRecords(@Nullable ContractGetRecordsQuery contractGetRecords) {
this.query = new OneOf<>(Query.QueryOneOfType.CONTRACT_GET_RECORDS,contractGetRecords);
return this;
}
/**
* (6) Get Records of the contract instance
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder contractGetRecords(ContractGetRecordsQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CONTRACT_GET_RECORDS, builder.build() );
return this;
}
/**
* (7) Get the current balance in a cryptocurrency account
*
* @param cryptogetAccountBalance value to set
* @return builder to continue building with
*/
public Builder cryptogetAccountBalance(@Nullable CryptoGetAccountBalanceQuery cryptogetAccountBalance) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTOGET_ACCOUNT_BALANCE,cryptogetAccountBalance);
return this;
}
/**
* (7) Get the current balance in a cryptocurrency account
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder cryptogetAccountBalance(CryptoGetAccountBalanceQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTOGET_ACCOUNT_BALANCE, builder.build() );
return this;
}
/**
* (8) Get all the records that currently exist for transactions involving an account
*
* @param cryptoGetAccountRecords value to set
* @return builder to continue building with
*/
public Builder cryptoGetAccountRecords(@Nullable CryptoGetAccountRecordsQuery cryptoGetAccountRecords) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTO_GET_ACCOUNT_RECORDS,cryptoGetAccountRecords);
return this;
}
/**
* (8) Get all the records that currently exist for transactions involving an account
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder cryptoGetAccountRecords(CryptoGetAccountRecordsQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTO_GET_ACCOUNT_RECORDS, builder.build() );
return this;
}
/**
* (9) Get all information about an account
*
* @param cryptoGetInfo value to set
* @return builder to continue building with
*/
public Builder cryptoGetInfo(@Nullable CryptoGetInfoQuery cryptoGetInfo) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTO_GET_INFO,cryptoGetInfo);
return this;
}
/**
* (9) Get all information about an account
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder cryptoGetInfo(CryptoGetInfoQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTO_GET_INFO, builder.build() );
return this;
}
/**
* (10) Get a single livehash from a single account, if present
*
* @param cryptoGetLiveHash value to set
* @return builder to continue building with
*/
public Builder cryptoGetLiveHash(@Nullable CryptoGetLiveHashQuery cryptoGetLiveHash) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTO_GET_LIVE_HASH,cryptoGetLiveHash);
return this;
}
/**
* (10) Get a single livehash from a single account, if present
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder cryptoGetLiveHash(CryptoGetLiveHashQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTO_GET_LIVE_HASH, builder.build() );
return this;
}
/**
* (11) Get all the accounts that proxy stake to a given account, and how much they proxy stake
* (not yet implemented in the current API)
*
* @param cryptoGetProxyStakers value to set
* @return builder to continue building with
*/
public Builder cryptoGetProxyStakers(@Nullable CryptoGetStakersQuery cryptoGetProxyStakers) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTO_GET_PROXY_STAKERS,cryptoGetProxyStakers);
return this;
}
/**
* (11) Get all the accounts that proxy stake to a given account, and how much they proxy stake
* (not yet implemented in the current API)
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder cryptoGetProxyStakers(CryptoGetStakersQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CRYPTO_GET_PROXY_STAKERS, builder.build() );
return this;
}
/**
* (12) Get the contents of a file (the bytes stored in it)
*
* @param fileGetContents value to set
* @return builder to continue building with
*/
public Builder fileGetContents(@Nullable FileGetContentsQuery fileGetContents) {
this.query = new OneOf<>(Query.QueryOneOfType.FILE_GET_CONTENTS,fileGetContents);
return this;
}
/**
* (12) Get the contents of a file (the bytes stored in it)
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder fileGetContents(FileGetContentsQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.FILE_GET_CONTENTS, builder.build() );
return this;
}
/**
* (13) Get information about a file, such as its expiration date
*
* @param fileGetInfo value to set
* @return builder to continue building with
*/
public Builder fileGetInfo(@Nullable FileGetInfoQuery fileGetInfo) {
this.query = new OneOf<>(Query.QueryOneOfType.FILE_GET_INFO,fileGetInfo);
return this;
}
/**
* (13) Get information about a file, such as its expiration date
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder fileGetInfo(FileGetInfoQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.FILE_GET_INFO, builder.build() );
return this;
}
/**
* (14) Get a receipt for a transaction (lasts 180 seconds)
*
* @param transactionGetReceipt value to set
* @return builder to continue building with
*/
public Builder transactionGetReceipt(@Nullable TransactionGetReceiptQuery transactionGetReceipt) {
this.query = new OneOf<>(Query.QueryOneOfType.TRANSACTION_GET_RECEIPT,transactionGetReceipt);
return this;
}
/**
* (14) Get a receipt for a transaction (lasts 180 seconds)
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder transactionGetReceipt(TransactionGetReceiptQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.TRANSACTION_GET_RECEIPT, builder.build() );
return this;
}
/**
* (15) Get a record for a transaction
*
* @param transactionGetRecord value to set
* @return builder to continue building with
*/
public Builder transactionGetRecord(@Nullable TransactionGetRecordQuery transactionGetRecord) {
this.query = new OneOf<>(Query.QueryOneOfType.TRANSACTION_GET_RECORD,transactionGetRecord);
return this;
}
/**
* (15) Get a record for a transaction
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder transactionGetRecord(TransactionGetRecordQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.TRANSACTION_GET_RECORD, builder.build() );
return this;
}
/**
* (16) Get a record for a transaction (lasts 180 seconds)
*
* @param transactionGetFastRecord value to set
* @return builder to continue building with
*/
public Builder transactionGetFastRecord(@Nullable TransactionGetFastRecordQuery transactionGetFastRecord) {
this.query = new OneOf<>(Query.QueryOneOfType.TRANSACTION_GET_FAST_RECORD,transactionGetFastRecord);
return this;
}
/**
* (16) Get a record for a transaction (lasts 180 seconds)
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder transactionGetFastRecord(TransactionGetFastRecordQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.TRANSACTION_GET_FAST_RECORD, builder.build() );
return this;
}
/**
* (50) Get the parameters of and state of a consensus topic.
*
* @param consensusGetTopicInfo value to set
* @return builder to continue building with
*/
public Builder consensusGetTopicInfo(@Nullable ConsensusGetTopicInfoQuery consensusGetTopicInfo) {
this.query = new OneOf<>(Query.QueryOneOfType.CONSENSUS_GET_TOPIC_INFO,consensusGetTopicInfo);
return this;
}
/**
* (50) Get the parameters of and state of a consensus topic.
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder consensusGetTopicInfo(ConsensusGetTopicInfoQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.CONSENSUS_GET_TOPIC_INFO, builder.build() );
return this;
}
/**
* (51) Get the versions of the HAPI protobuf and Hedera Services software deployed on the
* responding node.
*
* @param networkGetVersionInfo value to set
* @return builder to continue building with
*/
public Builder networkGetVersionInfo(@Nullable NetworkGetVersionInfoQuery networkGetVersionInfo) {
this.query = new OneOf<>(Query.QueryOneOfType.NETWORK_GET_VERSION_INFO,networkGetVersionInfo);
return this;
}
/**
* (51) Get the versions of the HAPI protobuf and Hedera Services software deployed on the
* responding node.
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder networkGetVersionInfo(NetworkGetVersionInfoQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.NETWORK_GET_VERSION_INFO, builder.build() );
return this;
}
/**
* (52) Get all information about a token
*
* @param tokenGetInfo value to set
* @return builder to continue building with
*/
public Builder tokenGetInfo(@Nullable TokenGetInfoQuery tokenGetInfo) {
this.query = new OneOf<>(Query.QueryOneOfType.TOKEN_GET_INFO,tokenGetInfo);
return this;
}
/**
* (52) Get all information about a token
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder tokenGetInfo(TokenGetInfoQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.TOKEN_GET_INFO, builder.build() );
return this;
}
/**
* (53) Get all information about a scheduled entity
*
* @param scheduleGetInfo value to set
* @return builder to continue building with
*/
public Builder scheduleGetInfo(@Nullable ScheduleGetInfoQuery scheduleGetInfo) {
this.query = new OneOf<>(Query.QueryOneOfType.SCHEDULE_GET_INFO,scheduleGetInfo);
return this;
}
/**
* (53) Get all information about a scheduled entity
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder scheduleGetInfo(ScheduleGetInfoQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.SCHEDULE_GET_INFO, builder.build() );
return this;
}
/**
* (54) Get a list of NFTs associated with the account
*
* @param tokenGetAccountNftInfos value to set
* @return builder to continue building with
*/
public Builder tokenGetAccountNftInfos(@Nullable TokenGetAccountNftInfosQuery tokenGetAccountNftInfos) {
this.query = new OneOf<>(Query.QueryOneOfType.TOKEN_GET_ACCOUNT_NFT_INFOS,tokenGetAccountNftInfos);
return this;
}
/**
* (54) Get a list of NFTs associated with the account
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder tokenGetAccountNftInfos(TokenGetAccountNftInfosQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.TOKEN_GET_ACCOUNT_NFT_INFOS, builder.build() );
return this;
}
/**
* (55) Get all information about a NFT
*
* @param tokenGetNftInfo value to set
* @return builder to continue building with
*/
public Builder tokenGetNftInfo(@Nullable TokenGetNftInfoQuery tokenGetNftInfo) {
this.query = new OneOf<>(Query.QueryOneOfType.TOKEN_GET_NFT_INFO,tokenGetNftInfo);
return this;
}
/**
* (55) Get all information about a NFT
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder tokenGetNftInfo(TokenGetNftInfoQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.TOKEN_GET_NFT_INFO, builder.build() );
return this;
}
/**
* (56) Get a list of NFTs for the token
*
* @param tokenGetNftInfos value to set
* @return builder to continue building with
*/
public Builder tokenGetNftInfos(@Nullable TokenGetNftInfosQuery tokenGetNftInfos) {
this.query = new OneOf<>(Query.QueryOneOfType.TOKEN_GET_NFT_INFOS,tokenGetNftInfos);
return this;
}
/**
* (56) Get a list of NFTs for the token
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder tokenGetNftInfos(TokenGetNftInfosQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.TOKEN_GET_NFT_INFOS, builder.build() );
return this;
}
/**
* (57) Gets handleTransaction times for one or more "sufficiently recent" TransactionIDs
*
* @param networkGetExecutionTime value to set
* @return builder to continue building with
*/
public Builder networkGetExecutionTime(@Nullable NetworkGetExecutionTimeQuery networkGetExecutionTime) {
this.query = new OneOf<>(Query.QueryOneOfType.NETWORK_GET_EXECUTION_TIME,networkGetExecutionTime);
return this;
}
/**
* (57) Gets handleTransaction times for one or more "sufficiently recent" TransactionIDs
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder networkGetExecutionTime(NetworkGetExecutionTimeQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.NETWORK_GET_EXECUTION_TIME, builder.build() );
return this;
}
/**
* (58) Gets all information about an account including allowances granted by the account
*
* @param accountDetails value to set
* @return builder to continue building with
*/
public Builder accountDetails(@Nullable GetAccountDetailsQuery accountDetails) {
this.query = new OneOf<>(Query.QueryOneOfType.ACCOUNT_DETAILS,accountDetails);
return this;
}
/**
* (58) Gets all information about an account including allowances granted by the account
*
* @param builder A pre-populated builder
* @return builder to continue building with
*/
public Builder accountDetails(GetAccountDetailsQuery.Builder builder) {
this.query = new OneOf<>(Query.QueryOneOfType.ACCOUNT_DETAILS, builder.build() );
return this;
}
}
/**
* Enum for the type of "query" oneof value
*/
public enum QueryOneOfType
implements com.hedera.pbj.runtime.EnumWithProtoMetadata {
/**
* Enum value for a unset OneOf, to avoid null OneOfs
*/
UNSET(-1, "UNSET"),
/**(1) Get all entities associated with a given key
*/
GET_BY_KEY(1, "getByKey"),
/**(2) Get the IDs in the format used in transactions, given the format used in Solidity
*/
GET_BY_SOLIDITY_ID(2, "getBySolidityID"),
/**(3) Call a function of a smart contract instance
*/
CONTRACT_CALL_LOCAL(3, "contractCallLocal"),
/**(4) Get information about a smart contract instance
*/
CONTRACT_GET_INFO(4, "contractGetInfo"),
/**(5) Get runtime code used by a smart contract instance
*/
CONTRACT_GET_BYTECODE(5, "contractGetBytecode"),
/**(6) Get Records of the contract instance
*/
CONTRACT_GET_RECORDS(6, "ContractGetRecords"),
/**(7) Get the current balance in a cryptocurrency account
*/
CRYPTOGET_ACCOUNT_BALANCE(7, "cryptogetAccountBalance"),
/**(8) Get all the records that currently exist for transactions involving an account
*/
CRYPTO_GET_ACCOUNT_RECORDS(8, "cryptoGetAccountRecords"),
/**(9) Get all information about an account
*/
CRYPTO_GET_INFO(9, "cryptoGetInfo"),
/**(10) Get a single livehash from a single account, if present
*/
CRYPTO_GET_LIVE_HASH(10, "cryptoGetLiveHash"),
/**(11) Get all the accounts that proxy stake to a given account, and how much they proxy stake
(not yet implemented in the current API)
*/
CRYPTO_GET_PROXY_STAKERS(11, "cryptoGetProxyStakers"),
/**(12) Get the contents of a file (the bytes stored in it)
*/
FILE_GET_CONTENTS(12, "fileGetContents"),
/**(13) Get information about a file, such as its expiration date
*/
FILE_GET_INFO(13, "fileGetInfo"),
/**(14) Get a receipt for a transaction (lasts 180 seconds)
*/
TRANSACTION_GET_RECEIPT(14, "transactionGetReceipt"),
/**(15) Get a record for a transaction
*/
TRANSACTION_GET_RECORD(15, "transactionGetRecord"),
/**(16) Get a record for a transaction (lasts 180 seconds)
*/
TRANSACTION_GET_FAST_RECORD(16, "transactionGetFastRecord"),
/**(50) Get the parameters of and state of a consensus topic.
*/
CONSENSUS_GET_TOPIC_INFO(50, "consensusGetTopicInfo"),
/**(51) Get the versions of the HAPI protobuf and Hedera Services software deployed on the
responding node.
*/
NETWORK_GET_VERSION_INFO(51, "networkGetVersionInfo"),
/**(52) Get all information about a token
*/
TOKEN_GET_INFO(52, "tokenGetInfo"),
/**(53) Get all information about a scheduled entity
*/
SCHEDULE_GET_INFO(53, "scheduleGetInfo"),
/**(54) Get a list of NFTs associated with the account
*/
TOKEN_GET_ACCOUNT_NFT_INFOS(54, "tokenGetAccountNftInfos"),
/**(55) Get all information about a NFT
*/
TOKEN_GET_NFT_INFO(55, "tokenGetNftInfo"),
/**(56) Get a list of NFTs for the token
*/
TOKEN_GET_NFT_INFOS(56, "tokenGetNftInfos"),
/**(57) Gets handleTransaction times for one or more "sufficiently recent" TransactionIDs
*/
NETWORK_GET_EXECUTION_TIME(57, "networkGetExecutionTime"),
/**(58) Gets all information about an account including allowances granted by the account
*/
ACCOUNT_DETAILS(58, "accountDetails")
;
/** The field ordinal in protobuf for this type */
private final int protoOrdinal;
/** The original field name in protobuf for this type */
private final String protoName;
/**
* OneOf Type Enum Constructor
*
* @param protoOrdinal The oneof field ordinal in protobuf for this type
* @param protoName The original field name in protobuf for this type
*/
QueryOneOfType(final int protoOrdinal, String protoName) {
this.protoOrdinal = protoOrdinal;
this.protoName = protoName;
}
/**
* Get the oneof field ordinal in protobuf for this type
*
* @return The oneof field ordinal in protobuf for this type
*/
public int protoOrdinal() {
return protoOrdinal;
}
/**
* Get the original field name in protobuf for this type
*
* @return The original field name in protobuf for this type
*/
public String protoName() {
return protoName;
}
/**
* Get enum from protobuf ordinal
*
* @param ordinal the protobuf ordinal number
* @return enum for matching ordinal
* @throws IllegalArgumentException if ordinal doesn't exist
*/
public static QueryOneOfType fromProtobufOrdinal(int ordinal) {
return switch(ordinal) {
case 1 -> GET_BY_KEY;
case 2 -> GET_BY_SOLIDITY_ID;
case 3 -> CONTRACT_CALL_LOCAL;
case 4 -> CONTRACT_GET_INFO;
case 5 -> CONTRACT_GET_BYTECODE;
case 6 -> CONTRACT_GET_RECORDS;
case 7 -> CRYPTOGET_ACCOUNT_BALANCE;
case 8 -> CRYPTO_GET_ACCOUNT_RECORDS;
case 9 -> CRYPTO_GET_INFO;
case 10 -> CRYPTO_GET_LIVE_HASH;
case 11 -> CRYPTO_GET_PROXY_STAKERS;
case 12 -> FILE_GET_CONTENTS;
case 13 -> FILE_GET_INFO;
case 14 -> TRANSACTION_GET_RECEIPT;
case 15 -> TRANSACTION_GET_RECORD;
case 16 -> TRANSACTION_GET_FAST_RECORD;
case 50 -> CONSENSUS_GET_TOPIC_INFO;
case 51 -> NETWORK_GET_VERSION_INFO;
case 52 -> TOKEN_GET_INFO;
case 53 -> SCHEDULE_GET_INFO;
case 54 -> TOKEN_GET_ACCOUNT_NFT_INFOS;
case 55 -> TOKEN_GET_NFT_INFO;
case 56 -> TOKEN_GET_NFT_INFOS;
case 57 -> NETWORK_GET_EXECUTION_TIME;
case 58 -> ACCOUNT_DETAILS;
default -> throw new IllegalArgumentException("Unknown protobuf ordinal "+ordinal);
};
}
/**
* Get enum from string name, supports the enum or protobuf format name
*
* @param name the enum or protobuf format name
* @return enum for matching name
*/
public static QueryOneOfType fromString(String name) {
return switch(name) {
case "getByKey", "GET_BY_KEY" -> GET_BY_KEY;
case "getBySolidityID", "GET_BY_SOLIDITY_ID" -> GET_BY_SOLIDITY_ID;
case "contractCallLocal", "CONTRACT_CALL_LOCAL" -> CONTRACT_CALL_LOCAL;
case "contractGetInfo", "CONTRACT_GET_INFO" -> CONTRACT_GET_INFO;
case "contractGetBytecode", "CONTRACT_GET_BYTECODE" -> CONTRACT_GET_BYTECODE;
case "ContractGetRecords", "CONTRACT_GET_RECORDS" -> CONTRACT_GET_RECORDS;
case "cryptogetAccountBalance", "CRYPTOGET_ACCOUNT_BALANCE" -> CRYPTOGET_ACCOUNT_BALANCE;
case "cryptoGetAccountRecords", "CRYPTO_GET_ACCOUNT_RECORDS" -> CRYPTO_GET_ACCOUNT_RECORDS;
case "cryptoGetInfo", "CRYPTO_GET_INFO" -> CRYPTO_GET_INFO;
case "cryptoGetLiveHash", "CRYPTO_GET_LIVE_HASH" -> CRYPTO_GET_LIVE_HASH;
case "cryptoGetProxyStakers", "CRYPTO_GET_PROXY_STAKERS" -> CRYPTO_GET_PROXY_STAKERS;
case "fileGetContents", "FILE_GET_CONTENTS" -> FILE_GET_CONTENTS;
case "fileGetInfo", "FILE_GET_INFO" -> FILE_GET_INFO;
case "transactionGetReceipt", "TRANSACTION_GET_RECEIPT" -> TRANSACTION_GET_RECEIPT;
case "transactionGetRecord", "TRANSACTION_GET_RECORD" -> TRANSACTION_GET_RECORD;
case "transactionGetFastRecord", "TRANSACTION_GET_FAST_RECORD" -> TRANSACTION_GET_FAST_RECORD;
case "consensusGetTopicInfo", "CONSENSUS_GET_TOPIC_INFO" -> CONSENSUS_GET_TOPIC_INFO;
case "networkGetVersionInfo", "NETWORK_GET_VERSION_INFO" -> NETWORK_GET_VERSION_INFO;
case "tokenGetInfo", "TOKEN_GET_INFO" -> TOKEN_GET_INFO;
case "scheduleGetInfo", "SCHEDULE_GET_INFO" -> SCHEDULE_GET_INFO;
case "tokenGetAccountNftInfos", "TOKEN_GET_ACCOUNT_NFT_INFOS" -> TOKEN_GET_ACCOUNT_NFT_INFOS;
case "tokenGetNftInfo", "TOKEN_GET_NFT_INFO" -> TOKEN_GET_NFT_INFO;
case "tokenGetNftInfos", "TOKEN_GET_NFT_INFOS" -> TOKEN_GET_NFT_INFOS;
case "networkGetExecutionTime", "NETWORK_GET_EXECUTION_TIME" -> NETWORK_GET_EXECUTION_TIME;
case "accountDetails", "ACCOUNT_DETAILS" -> ACCOUNT_DETAILS;
default -> throw new IllegalArgumentException("Unknown token kyc status "+name);
};
}
}
}