Package com.castlabs.android.network

# Class Response

java.lang.Object
com.castlabs.android.network.Response

public class Response extends Object
A modifiable response. You can use an instance of this class in a `ResponseModifier` to change the transformed data.

Since:
  4.1.2

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static @interface`
  `Response.ResponseType`
  Represents a request data type

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DATA_TYPE_DRM_LICENSE`
  Request type for DRM license requests
  `static final int`
  `DATA_TYPE_DRM_PROVISION`
  Request type for DRM provisioning requests
  `static final int`
  `DATA_TYPE_OTHER`
  Request type for other requests, such as Manifest or Media chunks.
  `final Map<String,List<String>>`
  `headers`
  The response headers
  `final int`
  `responseCode`
  Response code in case of HTTP.
  `final int`
  `type`
  The response type.
  `final Uri`
  `uri`
  The URI of this request

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Response(int type, Uri uri, Map<String,List<String>> headers, int code, byte[] data)`
  Create a new response with the given URI and headers

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `getData()`
  Get the data that was returned by the request
  `void`
  `setData(byte[] data)`
  Use this to set modified response data

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DATA_TYPE_DRM_PROVISION

    public static final int DATA_TYPE_DRM_PROVISION
    Request type for DRM provisioning requests
    See Also:
      - Constant Field Values

  - ### DATA_TYPE_DRM_LICENSE

    public static final int DATA_TYPE_DRM_LICENSE
    Request type for DRM license requests
    See Also:
      - Constant Field Values

  - ### DATA_TYPE_OTHER

    public static final int DATA_TYPE_OTHER
    Request type for other requests, such as Manifest or Media chunks.
    See Also:
      - Constant Field Values

  - ### headers

    @NonNull public final Map<String,List<String>> headers
    The response headers

  - ### type

    public final int type
    The response type.

  - ### uri

    @NonNull public final Uri uri
    The URI of this request

  - ### responseCode

    public final int responseCode
    Response code in case of HTTP. May be -1 if not available.

- ## Constructor Details

  - ### Response

    public Response(int type, @NonNull Uri uri, @Nullable Map<String,List<String>> headers, int code, @Nullable byte[] data)
    Create a new response with the given URI and headers
    Parameters:
      `type` - The request type.
      `uri` - The URI. Null is not permitted
      `headers` - The headers
      `code` - The response code
      `data` - The response data

- ## Method Details

  - ### getData

    @Nullable public byte[] getData()
    Get the data that was returned by the request
    Returns:
      The data or null

  - ### setData

    public void setData(@Nullable byte[] data)
    Use this to set modified response data
    Parameters:
      `data` - The data