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 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