Class ResponseHeader.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<ResponseHeader,ResponseHeader.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<ResponseHeader,ResponseHeader.Builder>
com.hedera.hashgraph.sdk.proto.ResponseHeader.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, ResponseHeaderOrBuilder, Cloneable
Enclosing class:
ResponseHeader

public static final class ResponseHeader.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<ResponseHeader,ResponseHeader.Builder> implements ResponseHeaderOrBuilder
 *
 A standard header returned with every query response.

 The fields for `cost` or `stateProof` MAY be unset if the requested
 `ResponseType` does not request those values.<br/>
 The `responseType` SHALL match the request response type.<br/>
 The `nodeTransactionPrecheckCode` field SHALL contain the result code
 for the query.
 
Protobuf type proto.ResponseHeader
  • Method Details

    • getNodeTransactionPrecheckCodeValue

      public int getNodeTransactionPrecheckCodeValue()
       *
       The result code for this query.
       <p>
       This value SHALL indicate either success or the reason for failure.
       
      .proto.ResponseCodeEnum nodeTransactionPrecheckCode = 1;
      Specified by:
      getNodeTransactionPrecheckCodeValue in interface ResponseHeaderOrBuilder
      Returns:
      The enum numeric value on the wire for nodeTransactionPrecheckCode.
    • setNodeTransactionPrecheckCodeValue

      public ResponseHeader.Builder setNodeTransactionPrecheckCodeValue(int value)
       *
       The result code for this query.
       <p>
       This value SHALL indicate either success or the reason for failure.
       
      .proto.ResponseCodeEnum nodeTransactionPrecheckCode = 1;
      Parameters:
      value - The nodeTransactionPrecheckCode to set.
      Returns:
      This builder for chaining.
      Throws:
      IllegalArgumentException - if UNRECOGNIZED is provided.
    • getNodeTransactionPrecheckCode

      public ResponseCodeEnum getNodeTransactionPrecheckCode()
       *
       The result code for this query.
       <p>
       This value SHALL indicate either success or the reason for failure.
       
      .proto.ResponseCodeEnum nodeTransactionPrecheckCode = 1;
      Specified by:
      getNodeTransactionPrecheckCode in interface ResponseHeaderOrBuilder
      Returns:
      The nodeTransactionPrecheckCode.
    • setNodeTransactionPrecheckCode

      public ResponseHeader.Builder setNodeTransactionPrecheckCode(ResponseCodeEnum value)
       *
       The result code for this query.
       <p>
       This value SHALL indicate either success or the reason for failure.
       
      .proto.ResponseCodeEnum nodeTransactionPrecheckCode = 1;
      Parameters:
      value - The enum numeric value on the wire for nodeTransactionPrecheckCode to set.
      Returns:
      This builder for chaining.
    • clearNodeTransactionPrecheckCode

      public ResponseHeader.Builder clearNodeTransactionPrecheckCode()
       *
       The result code for this query.
       <p>
       This value SHALL indicate either success or the reason for failure.
       
      .proto.ResponseCodeEnum nodeTransactionPrecheckCode = 1;
      Returns:
      This builder for chaining.
    • getResponseTypeValue

      public int getResponseTypeValue()
       *
       The response type requested for this query.
       <p>
       This SHALL be the response type requested in the query header.
       
      .proto.ResponseType responseType = 2;
      Specified by:
      getResponseTypeValue in interface ResponseHeaderOrBuilder
      Returns:
      The enum numeric value on the wire for responseType.
    • setResponseTypeValue

      public ResponseHeader.Builder setResponseTypeValue(int value)
       *
       The response type requested for this query.
       <p>
       This SHALL be the response type requested in the query header.
       
      .proto.ResponseType responseType = 2;
      Parameters:
      value - The responseType to set.
      Returns:
      This builder for chaining.
      Throws:
      IllegalArgumentException - if UNRECOGNIZED is provided.
    • getResponseType

      public ResponseType getResponseType()
       *
       The response type requested for this query.
       <p>
       This SHALL be the response type requested in the query header.
       
      .proto.ResponseType responseType = 2;
      Specified by:
      getResponseType in interface ResponseHeaderOrBuilder
      Returns:
      The responseType.
    • setResponseType

      public ResponseHeader.Builder setResponseType(ResponseType value)
       *
       The response type requested for this query.
       <p>
       This SHALL be the response type requested in the query header.
       
      .proto.ResponseType responseType = 2;
      Parameters:
      value - The enum numeric value on the wire for responseType to set.
      Returns:
      This builder for chaining.
    • clearResponseType

      public ResponseHeader.Builder clearResponseType()
       *
       The response type requested for this query.
       <p>
       This SHALL be the response type requested in the query header.
       
      .proto.ResponseType responseType = 2;
      Returns:
      This builder for chaining.
    • getCost

      public long getCost()
       *
       Requested cost estimate.<br/>
       This is the fee that _would be_ charged if the query was executed.
       <p>
       This value SHALL be set if the response type requested requires cost
       information, and SHALL NOT be set otherwise.<br/>
       This value SHALL include the query fee, but SHALL NOT include the
       transfer fee required to execute the fee payment transaction.
       
      uint64 cost = 3;
      Specified by:
      getCost in interface ResponseHeaderOrBuilder
      Returns:
      The cost.
    • setCost

      public ResponseHeader.Builder setCost(long value)
       *
       Requested cost estimate.<br/>
       This is the fee that _would be_ charged if the query was executed.
       <p>
       This value SHALL be set if the response type requested requires cost
       information, and SHALL NOT be set otherwise.<br/>
       This value SHALL include the query fee, but SHALL NOT include the
       transfer fee required to execute the fee payment transaction.
       
      uint64 cost = 3;
      Parameters:
      value - The cost to set.
      Returns:
      This builder for chaining.
    • clearCost

      public ResponseHeader.Builder clearCost()
       *
       Requested cost estimate.<br/>
       This is the fee that _would be_ charged if the query was executed.
       <p>
       This value SHALL be set if the response type requested requires cost
       information, and SHALL NOT be set otherwise.<br/>
       This value SHALL include the query fee, but SHALL NOT include the
       transfer fee required to execute the fee payment transaction.
       
      uint64 cost = 3;
      Returns:
      This builder for chaining.
    • getStateProof

      public com.google.protobuf.ByteString getStateProof()
       *
       A state proof for the information requested.
      
       This field SHALL NOT be set if the response type does not require
       a state proof.<br/>
       This field SHALL NOT be set if a state proof is not available for
       the query type.<br/>
       This field SHALL be set if the response type requested a state proof
       and a state proof is available.
       
      bytes stateProof = 4;
      Specified by:
      getStateProof in interface ResponseHeaderOrBuilder
      Returns:
      The stateProof.
    • setStateProof

      public ResponseHeader.Builder setStateProof(com.google.protobuf.ByteString value)
       *
       A state proof for the information requested.
      
       This field SHALL NOT be set if the response type does not require
       a state proof.<br/>
       This field SHALL NOT be set if a state proof is not available for
       the query type.<br/>
       This field SHALL be set if the response type requested a state proof
       and a state proof is available.
       
      bytes stateProof = 4;
      Parameters:
      value - The stateProof to set.
      Returns:
      This builder for chaining.
    • clearStateProof

      public ResponseHeader.Builder clearStateProof()
       *
       A state proof for the information requested.
      
       This field SHALL NOT be set if the response type does not require
       a state proof.<br/>
       This field SHALL NOT be set if a state proof is not available for
       the query type.<br/>
       This field SHALL be set if the response type requested a state proof
       and a state proof is available.
       
      bytes stateProof = 4;
      Returns:
      This builder for chaining.