Package scheduler.model
Class Appointment
- java.lang.Object
-
- scheduler.model.Appointment
-
public class Appointment extends java.lang.Object
A class to manage a singular Appointment object
-
-
Field Summary
Fields Modifier and Type Field Description private int
AppointmentID
private int
ContactID
private java.lang.String
ContactName
private int
CustomerID
private java.lang.String
description
private java.time.ZonedDateTime
end
private java.lang.String
FormattedEnd
private java.lang.String
FormattedStart
private java.lang.String
location
private java.time.ZonedDateTime
start
private java.lang.String
title
private java.lang.String
type
private int
UserID
-
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 appointmentint
getContactID()
Returns the ContactIDjava.lang.String
getContactName()
Get the Contact Name associated with the Contact IDint
getCustomerID()
Return the customer IDjava.lang.String
getDescription()
Returns the description of an appointmentjava.time.ZonedDateTime
getEnd()
Return the end timejava.lang.String
getFormattedEnd()
Return a formatted string for displaying end timejava.lang.String
getFormattedStart()
Return a formatted string for displaying start timejava.lang.String
getLocation()
Returns the location of an appointmentjava.time.ZonedDateTime
getStart()
Return the start date/time.java.lang.String
getTitle()
Returns the title of an appointmentjava.lang.String
getType()
Return the appointment typeint
getUserID()
Get the User IDvoid
setAppointmentID(int appointmentID)
Sets the appointment ID for the appointmentvoid
setContactID(int contactID)
Sets the contact idvoid
setContactName(java.lang.String contactName)
Set the Contact Name associated with the Contact Idvoid
setCustomerID(int customerID)
Set the customer IDvoid
setDescription(java.lang.String description)
Sets the description of an appointmentvoid
setEnd(java.time.ZonedDateTime end)
Set the end timevoid
setFormattedEnd(java.time.ZonedDateTime time)
Creates a string based human readlable version of the end time for the UIvoid
setFormattedStart(java.time.ZonedDateTime time)
Creates a String based human readable version of the start time for the UIvoid
setLocation(java.lang.String location)
Sets the location of an appointmentvoid
setStart(java.time.ZonedDateTime start)
Set the start date/timevoid
setTitle(java.lang.String title)
Set the title of an appointmentvoid
setType(java.lang.String type)
Set the appointment typevoid
setUserID(int userID)
Set the UserID
-
-
-
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-assignedtitle
- String, title of the appointmentdescription
- String, descriptionlocation
- String, locationcontactID
- integertype
- String, appointment typestart
- ZonedDateTime, start timeend
- ZonedDateTime, end timecustomerID
- int customer iduserID
- 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 appointmentdescription
- String, descriptionlocation
- String, locationcontactID
- integertype
- String, appointment typestart
- ZonedDateTime, start timeend
- ZonedDateTime, end timecustomerID
- int customer iduserID
- 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
-
-