Package com.castlabs.android.network

# Class NetworkMessage<HeaderValueType>

java.lang.Object
com.castlabs.android.network.NetworkMessage<HeaderValueType>

Type Parameters:
  `HeaderValueType` - The type of the header values

Direct Known Subclasses:
  `Request`, `Response`

public abstract class NetworkMessage<HeaderValueType> extends Object
Base class for network requests and responses

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `getData()`
  Get the payload that will be sent with the request.
  `Object`
  `getTag()`
  Get the tag that can be used to correlate responses.
  `Uri`
  `getUri()`
  Get the request URI.
  `void`
  `setData(byte[] data)`
  Set the payload to send with the request.

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

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

- ## Method Details

  - ### getUri

    @NonNull public Uri getUri()
    Get the request URI.
    Returns:
      The request URI. Query parameters are not applied yet

  - ### getData

    @Nullable public byte[] getData()
    Get the payload that will be sent with the request.
    Returns:
      Optional request body bytes

  - ### setData

    public void setData(@Nullable byte[] data)
    Set the payload to send with the request.
    Parameters:
      `data` - Request body bytes or `null` when no payload should be sent

  - ### getTag

    @Nullable public Object getTag()
    Get the tag that can be used to correlate responses.
    Returns:
      Marker object associated with the request