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
    Constructor
    Description
    Request(@NonNull String apiName, @NonNull String apiVersion, @NonNull String id, @NonNull String type, @NonNull com.google.gson.JsonObject payload)
    Creates an instance of a Request record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull String
    Returns the value of the apiName record component.
    @NonNull String
    Returns the value of the apiVersion record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NonNull String
    id()
    Returns the value of the id record component.
    @NonNull com.google.gson.JsonObject
    Returns the value of the payload record component.
    final String
    Returns a string representation of this record class.
    @NonNull String
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a Request record class.
      Parameters:
      apiName - the value for the apiName record component
      apiVersion - the value for the apiVersion record component
      id - the value for the id record component
      type - the value for the type record component
      payload - the value for the payload record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • apiName

      @SerializedName("apiName") public @NonNull String apiName()
      Returns the value of the apiName record component.
      Returns:
      the value of the apiName record component
    • apiVersion

      @SerializedName("apiVersion") public @NonNull String apiVersion()
      Returns the value of the apiVersion record component.
      Returns:
      the value of the apiVersion record component
    • id

      @SerializedName("requestID") public @NonNull String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • type

      @SerializedName("messageType") public @NonNull String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • payload

      @SerializedName("data") public @NonNull com.google.gson.JsonObject payload()
      Returns the value of the payload record component.
      Returns:
      the value of the payload record component