Package scheduler.model
Class Customer
- java.lang.Object
-
- scheduler.model.Customer
-
public class Customer extends java.lang.Object
A class to manage a singular customer object. Maintains the data members that are used throughout the program.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
Address
private int
CountryID
private int
CustomerID
private int
DivisionID
private java.lang.String
Name
private java.lang.String
PhoneNumber
private java.lang.String
PostalCode
-
Constructor Summary
Constructors Constructor Description Customer(int id, java.lang.String Name, java.lang.String Address, java.lang.String PostalCode, java.lang.String phone, int DivID, int Country)
Constructor for the Customer class (Default)Customer(java.lang.String Name, java.lang.String Address, java.lang.String PostalCode, java.lang.String phone, int DivID, int Country)
Overloaded constructor for adding a new customer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAddress()
Get the Address for the customer.int
getCountryID()
Return the country IDint
getCustomerID()
Get the Customer IDint
getDivisionID()
Return the Division IDjava.lang.String
getName()
Get the name of the customerjava.lang.String
getPhoneNumber()
Returns the Customer's Phone numberjava.lang.String
getPostalCode()
Return the postal codevoid
setAddress(java.lang.String address)
Set an address for the customer.void
setCountryID(int countryID)
Set the country idvoid
setCustomerID(int customerID)
Add Customer ID for a Customervoid
setDivisionID(int divisionID)
Set the division idvoid
setName(java.lang.String name)
Set name for the customervoid
setPhoneNumber(java.lang.String phoneNumber)
Add the phone numbervoid
setPostalCode(java.lang.String postalCode)
Set the postal codejava.lang.String
toString()
Overrides .toString() so that Customer name is used to represent the Object in human readalbe form.
-
-
-
Constructor Detail
-
Customer
public Customer(int id, java.lang.String Name, java.lang.String Address, java.lang.String PostalCode, java.lang.String phone, int DivID, int Country)
Constructor for the Customer class (Default)- Parameters:
id
- Integer, refers to the Customer idAddress
- String, is the address stringPostalCode
- String, Postal codephone
- String, Customer's phone numberDivID
- Integer, The Division IDCountry
- Integer, The country ID
-
Customer
public Customer(java.lang.String Name, java.lang.String Address, java.lang.String PostalCode, java.lang.String phone, int DivID, int Country)
Overloaded constructor for adding a new customer. This is currently used in the scenario where the customer id has yet to be assigned.- Parameters:
Name
- String, full name of customerAddress
- String, Primary address linePostalCode
- String, Postal codephone
- String, phone numberDivID
- int, value represents the division idCountry
- int, value represents the country id
-
-
Method Detail
-
toString
public java.lang.String toString()
Overrides .toString() so that Customer name is used to represent the Object in human readalbe form.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String, Customer name
-
getCustomerID
public int getCustomerID()
Get the Customer ID- Returns:
- an integer value for the customer ID
-
setCustomerID
public void setCustomerID(int customerID)
Add Customer ID for a Customer- Parameters:
customerID
- integer value
-
getAddress
public java.lang.String getAddress()
Get the Address for the customer.- Returns:
- a String for the address value. Note: The Division Id and Country ID are stored is their own variables.
-
setAddress
public void setAddress(java.lang.String address)
Set an address for the customer.- Parameters:
address
- String for the address. Note: The Country and Division information should not be included in this String. Both have their own variables.
-
getPostalCode
public java.lang.String getPostalCode()
Return the postal code- Returns:
- value is a string
-
setPostalCode
public void setPostalCode(java.lang.String postalCode)
Set the postal code- Parameters:
postalCode
- is a string that corresponds to the customer's postal code.
-
getPhoneNumber
public java.lang.String getPhoneNumber()
Returns the Customer's Phone number- Returns:
- a String that corresponds to the customer's phone number.
-
setPhoneNumber
public void setPhoneNumber(java.lang.String phoneNumber)
Add the phone number- Parameters:
phoneNumber
- String parameter that represents a Customer's phone number.
-
getDivisionID
public int getDivisionID()
Return the Division ID- Returns:
- Division ID in it's integer value.
-
setDivisionID
public void setDivisionID(int divisionID)
Set the division id- Parameters:
divisionID
- is an integer that corresponds with the divisionID
-
getCountryID
public int getCountryID()
Return the country ID- Returns:
- integer value that corresponds with the assigned integer id.
-
setCountryID
public void setCountryID(int countryID)
Set the country id- Parameters:
countryID
- integer value that corresponds with the Country ID value.
-
getName
public java.lang.String getName()
Get the name of the customer- Returns:
- string will full name
-
setName
public void setName(java.lang.String name)
Set name for the customer- Parameters:
name
- is a string that is comprised of full name
-
-