Class DataPacket<T>

java.lang.Object
cz.cuni.kubinja.hospitalsystem.packet.GeneralPacket
cz.cuni.kubinja.hospitalsystem.packet.DataPacket<T>
Type Parameters:
T - Type of the data that will be attached to the API response.

public class DataPacket<T> extends GeneralPacket
Extension of the general packet that also provides caller with the data output connected to the API request.
  • Field Details

    • data

      public final T data
      Data wrapper inside the data packet
  • Constructor Details

    • DataPacket

      public DataPacket(T data)
      Creates successful data packet based on provided data.
      Parameters:
      data - Data that will be stored in data packet (representing API data response).
    • DataPacket

      public DataPacket(Exception exception)
      Creates unsuccessful data packet.
      Parameters:
      exception - Exception that occurs while processing the API request.