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
ConstructorDescriptionResponseContext
(TransportResponseHandler<T> handler, Transport.Connection connection, String action, long requestId) Creates an instance of aResponseContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionaction()
Returns the value of theaction
record component.Returns the value of theconnection
record component.final boolean
Indicates whether some other object is "equal to" this one.handler()
Returns the value of thehandler
record component.final int
hashCode()
Returns a hash code value for this object.long
Returns the value of therequestId
record component.final String
toString()
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 aResponseContext
record class.- Parameters:
handler
- the value for thehandler
record componentconnection
- the value for theconnection
record componentaction
- the value for theaction
record componentrequestId
- the value for therequestId
record 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 thehandler
record component.- Returns:
- the value of the
handler
record component
-
connection
Returns the value of theconnection
record component.- Returns:
- the value of the
connection
record component
-
action
Returns the value of theaction
record component.- Returns:
- the value of the
action
record component
-
requestId
public long requestId()Returns the value of therequestId
record component.- Returns:
- the value of the
requestId
record component
-