Record Class Request

java.lang.Object
java.lang.Record
dev.adlin.vts4j.entity.Request

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

    Modifier and Type
    Method
    Description
    @NotNull String
    Returns the value of the apiName record component.
    @NotNull 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.
    @NotNull String
    id()
    Returns the value of the id record component.
    @NotNull com.google.gson.JsonObject
    Returns the value of the payload record component.
    final String
    Returns a string representation of this record class.
    @NotNull 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(@NotNull @NotNull String apiName, @NotNull @NotNull String apiVersion, @NotNull @NotNull String id, @NotNull @NotNull String type, @NotNull @NotNull 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") @NotNull public @NotNull String apiName()
      Returns the value of the apiName record component.
      Returns:
      the value of the apiName record component
    • apiVersion

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

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

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

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