Class Appointment


  • public class Appointment
    extends java.lang.Object
    A class to manage a singular Appointment object
    • Constructor Summary

      Constructors 
      Constructor Description
      Appointment()
      Default constructor with no parameters.
      Appointment​(int appointmentID, java.lang.String title, java.lang.String description, java.lang.String location, int contactID, java.lang.String type, java.time.ZonedDateTime start, java.time.ZonedDateTime end, int customerID, int userID)
      Default Constructor for adding a new Appointment.
      Appointment​(java.lang.String title, java.lang.String description, java.lang.String location, int contactID, java.lang.String type, java.time.ZonedDateTime start, java.time.ZonedDateTime end, int customerID, int userID)
      Constructor for modified appointments.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAppointmentID()
      Returns the Appointment ID for the appointment
      int getContactID()
      Returns the ContactID
      java.lang.String getContactName()
      Get the Contact Name associated with the Contact ID
      int getCustomerID()
      Return the customer ID
      java.lang.String getDescription()
      Returns the description of an appointment
      java.time.ZonedDateTime getEnd()
      Return the end time
      java.lang.String getFormattedEnd()
      Return a formatted string for displaying end time
      java.lang.String getFormattedStart()
      Return a formatted string for displaying start time
      java.lang.String getLocation()
      Returns the location of an appointment
      java.time.ZonedDateTime getStart()
      Return the start date/time.
      java.lang.String getTitle()
      Returns the title of an appointment
      java.lang.String getType()
      Return the appointment type
      int getUserID()
      Get the User ID
      void setAppointmentID​(int appointmentID)
      Sets the appointment ID for the appointment
      void setContactID​(int contactID)
      Sets the contact id
      void setContactName​(java.lang.String contactName)
      Set the Contact Name associated with the Contact Id
      void setCustomerID​(int customerID)
      Set the customer ID
      void setDescription​(java.lang.String description)
      Sets the description of an appointment
      void setEnd​(java.time.ZonedDateTime end)
      Set the end time
      void setFormattedEnd​(java.time.ZonedDateTime time)
      Creates a string based human readlable version of the end time for the UI
      void setFormattedStart​(java.time.ZonedDateTime time)
      Creates a String based human readable version of the start time for the UI
      void setLocation​(java.lang.String location)
      Sets the location of an appointment
      void setStart​(java.time.ZonedDateTime start)
      Set the start date/time
      void setTitle​(java.lang.String title)
      Set the title of an appointment
      void setType​(java.lang.String type)
      Set the appointment type
      void setUserID​(int userID)
      Set the UserID
      • Methods inherited from class java.lang.Object

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

      • AppointmentID

        private int AppointmentID
      • title

        private java.lang.String title
      • description

        private java.lang.String description
      • location

        private java.lang.String location
      • ContactID

        private int ContactID
      • type

        private java.lang.String type
      • start

        private java.time.ZonedDateTime start
      • end

        private java.time.ZonedDateTime end
      • CustomerID

        private int CustomerID
      • UserID

        private int UserID
      • ContactName

        private java.lang.String ContactName
      • FormattedStart

        private java.lang.String FormattedStart
      • FormattedEnd

        private java.lang.String FormattedEnd
    • Constructor Detail

      • Appointment

        public Appointment​(int appointmentID,
                           java.lang.String title,
                           java.lang.String description,
                           java.lang.String location,
                           int contactID,
                           java.lang.String type,
                           java.time.ZonedDateTime start,
                           java.time.ZonedDateTime end,
                           int customerID,
                           int userID)
        Default Constructor for adding a new Appointment. Contact Name is generated by the constructor
        Parameters:
        appointmentID - integer, auto-assigned
        title - String, title of the appointment
        description - String, description
        location - String, location
        contactID - integer
        type - String, appointment type
        start - ZonedDateTime, start time
        end - ZonedDateTime, end time
        customerID - int customer id
        userID - int user id
      • Appointment

        public Appointment()
        Default constructor with no parameters. This populates null values to an empty appointment object which can be initialized later.
      • Appointment

        public Appointment​(java.lang.String title,
                           java.lang.String description,
                           java.lang.String location,
                           int contactID,
                           java.lang.String type,
                           java.time.ZonedDateTime start,
                           java.time.ZonedDateTime end,
                           int customerID,
                           int userID)
        Constructor for modified appointments. Contact name is generated by the constructor
        Parameters:
        title - String, title of the appointment
        description - String, description
        location - String, location
        contactID - integer
        type - String, appointment type
        start - ZonedDateTime, start time
        end - ZonedDateTime, end time
        customerID - int customer id
        userID - int user id
    • Method Detail

      • getAppointmentID

        public int getAppointmentID()
        Returns the Appointment ID for the appointment
        Returns:
        Integer, AppointmentID
      • setAppointmentID

        public void setAppointmentID​(int appointmentID)
        Sets the appointment ID for the appointment
        Parameters:
        appointmentID - Integer, AppointmentID
      • getTitle

        public java.lang.String getTitle()
        Returns the title of an appointment
        Returns:
        String, title.
      • setTitle

        public void setTitle​(java.lang.String title)
        Set the title of an appointment
        Parameters:
        title - String, title
      • getDescription

        public java.lang.String getDescription()
        Returns the description of an appointment
        Returns:
        String, description
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets the description of an appointment
        Parameters:
        description - String, description
      • getLocation

        public java.lang.String getLocation()
        Returns the location of an appointment
        Returns:
        String, location
      • setLocation

        public void setLocation​(java.lang.String location)
        Sets the location of an appointment
        Parameters:
        location - String, location
      • getContactID

        public int getContactID()
        Returns the ContactID
        Returns:
        Integer, the ContactID
      • setContactID

        public void setContactID​(int contactID)
        Sets the contact id
        Parameters:
        contactID - Integer, ContactID
      • getType

        public java.lang.String getType()
        Return the appointment type
        Returns:
        String, type
      • setType

        public void setType​(java.lang.String type)
        Set the appointment type
        Parameters:
        type - String, type
      • getStart

        public java.time.ZonedDateTime getStart()
        Return the start date/time.
        Returns:
        LocalDateTime, start date and time
      • setStart

        public void setStart​(java.time.ZonedDateTime start)
        Set the start date/time
        Parameters:
        start - LocalDateTime, start date and time
      • getEnd

        public java.time.ZonedDateTime getEnd()
        Return the end time
        Returns:
        LocalDateTime, endtime
      • setEnd

        public void setEnd​(java.time.ZonedDateTime end)
        Set the end time
        Parameters:
        end - LocalDateTime end
      • getCustomerID

        public int getCustomerID()
        Return the customer ID
        Returns:
        String, Customer ID
      • setCustomerID

        public void setCustomerID​(int customerID)
        Set the customer ID
        Parameters:
        customerID - Integer CustomerID
      • getUserID

        public int getUserID()
        Get the User ID
        Returns:
        Integer, User ID
      • setUserID

        public void setUserID​(int userID)
        Set the UserID
        Parameters:
        userID - Integer, User ID
      • getContactName

        public java.lang.String getContactName()
        Get the Contact Name associated with the Contact ID
        Returns:
        String, contact name
      • setContactName

        public void setContactName​(java.lang.String contactName)
        Set the Contact Name associated with the Contact Id
        Parameters:
        contactName - String, contact name associated with Integer ID
      • setFormattedStart

        public void setFormattedStart​(java.time.ZonedDateTime time)
        Creates a String based human readable version of the start time for the UI
        Parameters:
        time - Zoned Date time
      • setFormattedEnd

        public void setFormattedEnd​(java.time.ZonedDateTime time)
        Creates a string based human readlable version of the end time for the UI
        Parameters:
        time - Zoned Date Time
      • getFormattedStart

        public java.lang.String getFormattedStart()
        Return a formatted string for displaying start time
        Returns:
        String
      • getFormattedEnd

        public java.lang.String getFormattedEnd()
        Return a formatted string for displaying end time
        Returns:
        String