Record Class RequestResponse
java.lang.Object
java.lang.Record
za.co.wethinkcode.robots.client.memory.RequestResponse
- Record Components:
command- which command was requestedrequest- raw untyped string of the request that was sentresponse- raw untyped string of the response that was received
public record RequestResponse(ImplementedClientCommands command, String request, String response)
extends Record
Struct record class storing the full flow of request and response
-
Constructor Summary
ConstructorsConstructorDescriptionRequestResponse(ImplementedClientCommands command, String request, String response) Creates an instance of aRequestResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptioncommand()Returns the value of thecommandrecord component.final booleanIndicates whether some other object is "equal to" this one.com.google.gson.JsonObjectGet a sent request back in the form of JSONcom.google.gson.JsonObjectGet a response that's already been logged back in the form of JSONfinal inthashCode()Returns a hash code value for this object.request()Returns the value of therequestrecord component.response()Returns the value of theresponserecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
getRequest
public com.google.gson.JsonObject getRequest()Get a sent request back in the form of JSON- Returns:
-
getResponse
public com.google.gson.JsonObject getResponse()Get a response that's already been logged back in the form of JSON- Returns:
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
command
Returns the value of thecommandrecord component.- Returns:
- the value of the
commandrecord component
-
request
Returns the value of therequestrecord component.- Returns:
- the value of the
requestrecord component
-
response
Returns the value of theresponserecord component.- Returns:
- the value of the
responserecord component
-