Module org.elasticsearch.xcore
Record Class QuestionAnsweringInferenceResults.TopAnswerEntry
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.ml.inference.results.QuestionAnsweringInferenceResults.TopAnswerEntry
- All Implemented Interfaces:
Writeable,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
- Enclosing class:
QuestionAnsweringInferenceResults
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.xcontent.ParseFieldstatic final Stringstatic final org.elasticsearch.xcontent.ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTopAnswerEntry(String answer, double score, int startOffset, int endOffset) Creates an instance of aTopAnswerEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionanswer()Returns the value of theanswerrecord component.intReturns the value of theendOffsetrecord component.final booleanIndicates whether some other object is "equal to" this one.fromXContent(org.elasticsearch.xcontent.XContentParser parser) final inthashCode()Returns a hash code value for this object.doublescore()Returns the value of thescorerecord component.intReturns the value of thestartOffsetrecord component.final StringtoString()Returns a string representation of this record class.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
ANSWER
public static final org.elasticsearch.xcontent.ParseField ANSWER -
SCORE
public static final org.elasticsearch.xcontent.ParseField SCORE -
NAME
- See Also:
-
-
Constructor Details
-
TopAnswerEntry
Creates an instance of aTopAnswerEntryrecord class.- Parameters:
answer- the value for theanswerrecord componentscore- the value for thescorerecord componentstartOffset- the value for thestartOffsetrecord componentendOffset- the value for theendOffsetrecord component
-
-
Method Details
-
fromStream
public static QuestionAnsweringInferenceResults.TopAnswerEntry fromStream(StreamInput in) throws IOException - Throws:
IOException
-
fromXContent
public static QuestionAnsweringInferenceResults.TopAnswerEntry fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
asValueMap
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
answer
Returns the value of theanswerrecord component.- Returns:
- the value of the
answerrecord component
-
score
public double score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
startOffset
public int startOffset()Returns the value of thestartOffsetrecord component.- Returns:
- the value of the
startOffsetrecord component
-
endOffset
public int endOffset()Returns the value of theendOffsetrecord component.- Returns:
- the value of the
endOffsetrecord component
-