Class GeneralPacket

java.lang.Object
cz.cuni.kubinja.hospitalsystem.packet.GeneralPacket
Direct Known Subclasses:
DataPacket

public class GeneralPacket extends Object
Wrapper for status information transported via API between hospital system and TUI menu.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Wrapper class containing messages connected with the packets.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    Error message of the exception that occurs while processing API request
    final boolean
    Denotes whether the API request connected to the packet was successful
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates general packet.
    Creates general packet.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns information message about the successfulness of the process.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • successful

      public final boolean successful
      Denotes whether the API request connected to the packet was successful
    • error

      public final String error
      Error message of the exception that occurs while processing API request
  • Constructor Details

    • GeneralPacket

      public GeneralPacket()
      Creates general packet.

      Constructor does not get any exception therefore object created via this constructor represents successful process.

    • GeneralPacket

      public GeneralPacket(Exception exception)
      Creates general packet.

      Constructs general packet that represents unsuccessful process.

      Parameters:
      exception - Exception that occurs via processing the API request.
  • Method Details

    • resolveStatus

      public String resolveStatus()
      Returns information message about the successfulness of the process.
      Returns:
      information message about the successfulness of the process.