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
    Constructor
    Description
    Response(@NotNull String apiName, @NotNull String apiVersion, long timestamp, @NotNull String requestType, @NotNull String requestId, @Nullable com.google.gson.JsonObject payload)
    Creates an instance of a Response 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.
    @Nullable com.google.gson.JsonObject
    Returns the value of the payload record component.
    @NotNull String
    Returns the value of the requestId record component.
    @NotNull String
    Returns the value of the requestType record component.
    long
    Returns the value of the timestamp record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a Response record class.
      Parameters:
      apiName - the value for the apiName record component
      apiVersion - the value for the apiVersion record component
      timestamp - the value for the timestamp record component
      requestType - the value for the requestType record component
      requestId - the value for the requestId 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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
    • timestamp

      @SerializedName("timestamp") public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • requestType

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

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

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