Module org.elasticsearch.server
Package org.elasticsearch.transport
Record Class Transport.ResponseContext<T extends TransportResponse>
java.lang.Object
java.lang.Record
org.elasticsearch.transport.Transport.ResponseContext<T>
- Enclosing interface:
Transport
public static record Transport.ResponseContext<T extends TransportResponse>(TransportResponseHandler<T extends TransportResponse> handler, Transport.Connection connection, String action, long requestId)
extends Record
This class represents a response context that encapsulates the actual response handler, the action. the connection it was
executed on, and the request ID.
-
Constructor Summary
ConstructorsConstructorDescriptionResponseContext(TransportResponseHandler<T> handler, Transport.Connection connection, String action, long requestId) Creates an instance of aResponseContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.Returns the value of theconnectionrecord component.final booleanIndicates whether some other object is "equal to" this one.handler()Returns the value of thehandlerrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of therequestIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ResponseContext
public ResponseContext(TransportResponseHandler<T> handler, Transport.Connection connection, String action, long requestId) Creates an instance of aResponseContextrecord class.- Parameters:
handler- the value for thehandlerrecord componentconnection- the value for theconnectionrecord componentaction- the value for theactionrecord componentrequestId- the value for therequestIdrecord component
-
-
Method Details
-
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 '=='. -
handler
Returns the value of thehandlerrecord component.- Returns:
- the value of the
handlerrecord component
-
connection
Returns the value of theconnectionrecord component.- Returns:
- the value of the
connectionrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
requestId
public long requestId()Returns the value of therequestIdrecord component.- Returns:
- the value of the
requestIdrecord component
-