Package dev.adlin.vts4j.entity
Record Class Request
java.lang.Object
java.lang.Record
dev.adlin.vts4j.entity.Request
public record Request(@NonNull String apiName, @NonNull String apiVersion, @NonNull String id, @NonNull String type, @NonNull com.google.gson.JsonObject payload)
extends Record
An object used to deserialize a request into JSON format and send it to the server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull StringapiName()Returns the value of theapiNamerecord component.@NonNull 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.@NonNull Stringid()Returns the value of theidrecord component.@NonNull com.google.gson.JsonObjectpayload()Returns the value of thepayloadrecord component.final StringtoString()Returns a string representation of this record class.@NonNull Stringtype()Returns the value of thetyperecord component.
-
Constructor Details
-
Request
public Request(@NonNull String apiName, @NonNull String apiVersion, @NonNull String id, @NonNull String type, @NonNull com.google.gson.JsonObject payload) Creates an instance of aRequestrecord class.- Parameters:
apiName- the value for theapiNamerecord componentapiVersion- the value for theapiVersionrecord componentid- the value for theidrecord componenttype- the value for thetyperecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
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
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
payload
@SerializedName("data") public @NonNull com.google.gson.JsonObject payload()Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-