Class CheckGroundingResponse.Claim.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CheckGroundingResponse.Claim.Builder>
com.google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.Builder
All Implemented Interfaces:
CheckGroundingResponse.ClaimOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
CheckGroundingResponse.Claim

public static final class CheckGroundingResponse.Claim.Builder extends com.google.protobuf.GeneratedMessage.Builder<CheckGroundingResponse.Claim.Builder> implements CheckGroundingResponse.ClaimOrBuilder
 Text and citation info for a claim in the answer candidate.
 
Protobuf type google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<CheckGroundingResponse.Claim.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<CheckGroundingResponse.Claim.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<CheckGroundingResponse.Claim.Builder>
    • getDefaultInstanceForType

      public CheckGroundingResponse.Claim getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public CheckGroundingResponse.Claim buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public CheckGroundingResponse.Claim.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CheckGroundingResponse.Claim.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<CheckGroundingResponse.Claim.Builder>
    • mergeFrom

      public CheckGroundingResponse.Claim.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CheckGroundingResponse.Claim.Builder>
      Throws:
      IOException
    • hasStartPos

      public boolean hasStartPos()
       Position indicating the start of the claim in the answer candidate,
       measured in bytes. Note that this is not measured in characters and,
       therefore, must be rendered in the user interface keeping in mind that
       some characters may take more than one byte. For example,
       if the claim text contains non-ASCII characters, the start and end
       positions vary when measured in characters
       (programming-language-dependent) and when measured in bytes
       (programming-language-independent).
       
      optional int32 start_pos = 1;
      Specified by:
      hasStartPos in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      Whether the startPos field is set.
    • getStartPos

      public int getStartPos()
       Position indicating the start of the claim in the answer candidate,
       measured in bytes. Note that this is not measured in characters and,
       therefore, must be rendered in the user interface keeping in mind that
       some characters may take more than one byte. For example,
       if the claim text contains non-ASCII characters, the start and end
       positions vary when measured in characters
       (programming-language-dependent) and when measured in bytes
       (programming-language-independent).
       
      optional int32 start_pos = 1;
      Specified by:
      getStartPos in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The startPos.
    • setStartPos

      public CheckGroundingResponse.Claim.Builder setStartPos(int value)
       Position indicating the start of the claim in the answer candidate,
       measured in bytes. Note that this is not measured in characters and,
       therefore, must be rendered in the user interface keeping in mind that
       some characters may take more than one byte. For example,
       if the claim text contains non-ASCII characters, the start and end
       positions vary when measured in characters
       (programming-language-dependent) and when measured in bytes
       (programming-language-independent).
       
      optional int32 start_pos = 1;
      Parameters:
      value - The startPos to set.
      Returns:
      This builder for chaining.
    • clearStartPos

      public CheckGroundingResponse.Claim.Builder clearStartPos()
       Position indicating the start of the claim in the answer candidate,
       measured in bytes. Note that this is not measured in characters and,
       therefore, must be rendered in the user interface keeping in mind that
       some characters may take more than one byte. For example,
       if the claim text contains non-ASCII characters, the start and end
       positions vary when measured in characters
       (programming-language-dependent) and when measured in bytes
       (programming-language-independent).
       
      optional int32 start_pos = 1;
      Returns:
      This builder for chaining.
    • hasEndPos

      public boolean hasEndPos()
       Position indicating the end of the claim in the answer candidate,
       exclusive, in bytes. Note that this is not measured in characters and,
       therefore, must be rendered as such. For example, if the claim text
       contains non-ASCII characters, the start and end positions vary when
       measured in characters (programming-language-dependent) and when measured
       in bytes (programming-language-independent).
       
      optional int32 end_pos = 2;
      Specified by:
      hasEndPos in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      Whether the endPos field is set.
    • getEndPos

      public int getEndPos()
       Position indicating the end of the claim in the answer candidate,
       exclusive, in bytes. Note that this is not measured in characters and,
       therefore, must be rendered as such. For example, if the claim text
       contains non-ASCII characters, the start and end positions vary when
       measured in characters (programming-language-dependent) and when measured
       in bytes (programming-language-independent).
       
      optional int32 end_pos = 2;
      Specified by:
      getEndPos in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The endPos.
    • setEndPos

      public CheckGroundingResponse.Claim.Builder setEndPos(int value)
       Position indicating the end of the claim in the answer candidate,
       exclusive, in bytes. Note that this is not measured in characters and,
       therefore, must be rendered as such. For example, if the claim text
       contains non-ASCII characters, the start and end positions vary when
       measured in characters (programming-language-dependent) and when measured
       in bytes (programming-language-independent).
       
      optional int32 end_pos = 2;
      Parameters:
      value - The endPos to set.
      Returns:
      This builder for chaining.
    • clearEndPos

       Position indicating the end of the claim in the answer candidate,
       exclusive, in bytes. Note that this is not measured in characters and,
       therefore, must be rendered as such. For example, if the claim text
       contains non-ASCII characters, the start and end positions vary when
       measured in characters (programming-language-dependent) and when measured
       in bytes (programming-language-independent).
       
      optional int32 end_pos = 2;
      Returns:
      This builder for chaining.
    • getClaimText

      public String getClaimText()
       Text for the claim in the answer candidate. Always provided regardless of
       whether citations or anti-citations are found.
       
      string claim_text = 3;
      Specified by:
      getClaimText in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The claimText.
    • getClaimTextBytes

      public com.google.protobuf.ByteString getClaimTextBytes()
       Text for the claim in the answer candidate. Always provided regardless of
       whether citations or anti-citations are found.
       
      string claim_text = 3;
      Specified by:
      getClaimTextBytes in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The bytes for claimText.
    • setClaimText

      public CheckGroundingResponse.Claim.Builder setClaimText(String value)
       Text for the claim in the answer candidate. Always provided regardless of
       whether citations or anti-citations are found.
       
      string claim_text = 3;
      Parameters:
      value - The claimText to set.
      Returns:
      This builder for chaining.
    • clearClaimText

      public CheckGroundingResponse.Claim.Builder clearClaimText()
       Text for the claim in the answer candidate. Always provided regardless of
       whether citations or anti-citations are found.
       
      string claim_text = 3;
      Returns:
      This builder for chaining.
    • setClaimTextBytes

      public CheckGroundingResponse.Claim.Builder setClaimTextBytes(com.google.protobuf.ByteString value)
       Text for the claim in the answer candidate. Always provided regardless of
       whether citations or anti-citations are found.
       
      string claim_text = 3;
      Parameters:
      value - The bytes for claimText to set.
      Returns:
      This builder for chaining.
    • getCitationIndicesList

      public List<Integer> getCitationIndicesList()
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Specified by:
      getCitationIndicesList in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      A list containing the citationIndices.
    • getCitationIndicesCount

      public int getCitationIndicesCount()
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Specified by:
      getCitationIndicesCount in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The count of citationIndices.
    • getCitationIndices

      public int getCitationIndices(int index)
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Specified by:
      getCitationIndices in interface CheckGroundingResponse.ClaimOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The citationIndices at the given index.
    • setCitationIndices

      public CheckGroundingResponse.Claim.Builder setCitationIndices(int index, int value)
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Parameters:
      index - The index to set the value at.
      value - The citationIndices to set.
      Returns:
      This builder for chaining.
    • addCitationIndices

      public CheckGroundingResponse.Claim.Builder addCitationIndices(int value)
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Parameters:
      value - The citationIndices to add.
      Returns:
      This builder for chaining.
    • addAllCitationIndices

      public CheckGroundingResponse.Claim.Builder addAllCitationIndices(Iterable<? extends Integer> values)
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Parameters:
      values - The citationIndices to add.
      Returns:
      This builder for chaining.
    • clearCitationIndices

      public CheckGroundingResponse.Claim.Builder clearCitationIndices()
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Returns:
      This builder for chaining.
    • hasGroundingCheckRequired

      public boolean hasGroundingCheckRequired()
       Indicates that this claim required grounding check. When the system
       decided this claim doesn't require attribution/grounding check, this
       field will be set to false. In that case, no grounding check was done for
       the claim and therefore
       [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices]
       should not be returned.
       
      optional bool grounding_check_required = 6;
      Specified by:
      hasGroundingCheckRequired in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      Whether the groundingCheckRequired field is set.
    • getGroundingCheckRequired

      public boolean getGroundingCheckRequired()
       Indicates that this claim required grounding check. When the system
       decided this claim doesn't require attribution/grounding check, this
       field will be set to false. In that case, no grounding check was done for
       the claim and therefore
       [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices]
       should not be returned.
       
      optional bool grounding_check_required = 6;
      Specified by:
      getGroundingCheckRequired in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The groundingCheckRequired.
    • setGroundingCheckRequired

      public CheckGroundingResponse.Claim.Builder setGroundingCheckRequired(boolean value)
       Indicates that this claim required grounding check. When the system
       decided this claim doesn't require attribution/grounding check, this
       field will be set to false. In that case, no grounding check was done for
       the claim and therefore
       [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices]
       should not be returned.
       
      optional bool grounding_check_required = 6;
      Parameters:
      value - The groundingCheckRequired to set.
      Returns:
      This builder for chaining.
    • clearGroundingCheckRequired

      public CheckGroundingResponse.Claim.Builder clearGroundingCheckRequired()
       Indicates that this claim required grounding check. When the system
       decided this claim doesn't require attribution/grounding check, this
       field will be set to false. In that case, no grounding check was done for
       the claim and therefore
       [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices]
       should not be returned.
       
      optional bool grounding_check_required = 6;
      Returns:
      This builder for chaining.
    • hasScore

      public boolean hasScore()
       Confidence score for the claim in the answer candidate, in the range of
       [0, 1]. This is set only when
       `CheckGroundingRequest.grounding_spec.enable_claim_level_score` is true.
       
      optional double score = 7;
      Specified by:
      hasScore in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      Whether the score field is set.
    • getScore

      public double getScore()
       Confidence score for the claim in the answer candidate, in the range of
       [0, 1]. This is set only when
       `CheckGroundingRequest.grounding_spec.enable_claim_level_score` is true.
       
      optional double score = 7;
      Specified by:
      getScore in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The score.
    • setScore

      public CheckGroundingResponse.Claim.Builder setScore(double value)
       Confidence score for the claim in the answer candidate, in the range of
       [0, 1]. This is set only when
       `CheckGroundingRequest.grounding_spec.enable_claim_level_score` is true.
       
      optional double score = 7;
      Parameters:
      value - The score to set.
      Returns:
      This builder for chaining.
    • clearScore

       Confidence score for the claim in the answer candidate, in the range of
       [0, 1]. This is set only when
       `CheckGroundingRequest.grounding_spec.enable_claim_level_score` is true.
       
      optional double score = 7;
      Returns:
      This builder for chaining.