Package dev.adlin.vts4j.entity
Record Class Response
java.lang.Object
java.lang.Record
dev.adlin.vts4j.entity.Response
public record Response(@NotNull String apiName, @NotNull String apiVersion, long timestamp, @NotNull String requestType, @NotNull String requestId, @Nullable com.google.gson.JsonObject payload)
extends Record
An object used to serialize the response from the server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull StringapiName()Returns the value of theapiNamerecord component.@NotNull StringReturns the value of theapiVersionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable com.google.gson.JsonObjectpayload()Returns the value of thepayloadrecord component.@NotNull StringReturns the value of therequestIdrecord component.@NotNull StringReturns the value of therequestTyperecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Response
public Response(@NotNull @NotNull String apiName, @NotNull @NotNull String apiVersion, long timestamp, @NotNull @NotNull String requestType, @NotNull @NotNull String requestId, @Nullable @Nullable com.google.gson.JsonObject payload) Creates an instance of aResponserecord class.- Parameters:
apiName- the value for theapiNamerecord componentapiVersion- the value for theapiVersionrecord componenttimestamp- the value for thetimestamprecord componentrequestType- the value for therequestTyperecord componentrequestId- the value for therequestIdrecord componentpayload- the value for thepayloadrecord 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 '=='. -
apiName
Returns the value of theapiNamerecord component.- Returns:
- the value of the
apiNamerecord component
-
apiVersion
Returns the value of theapiVersionrecord component.- Returns:
- the value of the
apiVersionrecord component
-
timestamp
@SerializedName("timestamp") public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
requestType
Returns the value of therequestTyperecord component.- Returns:
- the value of the
requestTyperecord component
-
requestId
Returns the value of therequestIdrecord component.- Returns:
- the value of the
requestIdrecord component
-
payload
@SerializedName("data") @Nullable public @Nullable com.google.gson.JsonObject payload()Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-