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
Represents a response envelope.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a builder for constructing ResponseEnvelope objects. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ResponseEnvelope.Builder<T>builder()Creates a new instance of Builder for building ResponseEnvelope objects.static <T> ResponseEnvelope.Builder<T>Creates a new instance of Builder for building ResponseEnvelope objects.getData()Retrieves the data contained in the response.Retrieves the metadata of the response.Retrieves the unique identifier of the request.Retrieves the current response status of the response.Retrieves the timestamp of the response.
-
Method Details
-
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
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
Retrieves the unique identifier of the request.- Returns:
- the request ID as a String
-
getStatus
Retrieves the current response status of the response.- Returns:
- the response status, which can be either SUCCESS or FAILED
-
getTimestamp
Retrieves the timestamp of the response.- Returns:
- the ZonedDateTime object representing the timestamp
-
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
Retrieves the data contained in the response.- Returns:
- the data of type T stored in the ResponseEnvelope
-