Class ResponseEnvelope<T>

java.lang.Object
com.helixframework.api.contract.HateoasResponse
com.helixframework.api.contract.envelope.ResponseEnvelope<T>
Type Parameters:
T - the type of data in the envelope

public class ResponseEnvelope<T> extends HateoasResponse
Represents a response envelope.
  • Method Details

    • builder

      public static <T> ResponseEnvelope.Builder<T> builder()
      Creates a new instance of Builder for building ResponseEnvelope objects.
      Type Parameters:
      T - the type of data to be contained in the ResponseEnvelope
      Returns:
      a new instance of Builder for the specified data type
    • builder

      public static <T> ResponseEnvelope.Builder<T> builder(Class<T> clazz)
      Creates a new instance of Builder for building ResponseEnvelope objects.
      Type Parameters:
      T - the type of data to be contained in the ResponseEnvelope
      Parameters:
      clazz - the class type parameter for the ResponseEnvelope
      Returns:
      a new instance of Builder for the specified class type
    • getRequestId

      public String getRequestId()
      Retrieves the unique identifier of the request.
      Returns:
      the request ID as a String
    • getStatus

      public ResponseStatus getStatus()
      Retrieves the current response status of the response.
      Returns:
      the response status, which can be either SUCCESS or FAILED
    • getTimestamp

      public ZonedDateTime getTimestamp()
      Retrieves the timestamp of the response.
      Returns:
      the ZonedDateTime object representing the timestamp
    • getMetadata

      public Map<String,Object> getMetadata()
      Retrieves the metadata of the response.
      Returns:
      a Map containing key-value pairs of metadata, where the keys are Strings and the values are Objects
    • getData

      public T getData()
      Retrieves the data contained in the response.
      Returns:
      the data of type T stored in the ResponseEnvelope