Class 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.
    • 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 ID
      int getCustomerID()
      Get the Customer ID
      int getDivisionID()
      Return the Division ID
      java.lang.String getName()
      Get the name of the customer
      java.lang.String getPhoneNumber()
      Returns the Customer's Phone number
      java.lang.String getPostalCode()
      Return the postal code
      void setAddress​(java.lang.String address)
      Set an address for the customer.
      void setCountryID​(int countryID)
      Set the country id
      void setCustomerID​(int customerID)
      Add Customer ID for a Customer
      void setDivisionID​(int divisionID)
      Set the division id
      void setName​(java.lang.String name)
      Set name for the customer
      void setPhoneNumber​(java.lang.String phoneNumber)
      Add the phone number
      void setPostalCode​(java.lang.String postalCode)
      Set the postal code
      java.lang.String toString()
      Overrides .toString() so that Customer name is used to represent the Object in human readalbe form.
      • Methods inherited from class java.lang.Object

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

      • CustomerID

        private int CustomerID
      • Name

        private java.lang.String Name
      • Address

        private java.lang.String Address
      • PostalCode

        private java.lang.String PostalCode
      • PhoneNumber

        private java.lang.String PhoneNumber
      • DivisionID

        private int DivisionID
      • CountryID

        private int CountryID
    • 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 id
        Address - String, is the address string
        PostalCode - String, Postal code
        phone - String, Customer's phone number
        DivID - Integer, The Division ID
        Country - 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 customer
        Address - String, Primary address line
        PostalCode - String, Postal code
        phone - String, phone number
        DivID - int, value represents the division id
        Country - 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 class java.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