Class DefaultCustomerService

  • All Implemented Interfaces:
    CustomerService

    public class DefaultCustomerService
    extends java.lang.Object
    implements CustomerService
    Provides methods for retrieving the customer and verify customer id
    • Constructor Detail

      • DefaultCustomerService

        public DefaultCustomerService​(CustomerDao customerDao,
                                      java.lang.String regexp)
        Service constructor
        Parameters:
        customerDao - DAO for retrieving customer
        regexp - regular expression for UUID validation
    • Method Detail

      • isUUID

        public boolean isUUID​(java.lang.String id)
        Description copied from interface: CustomerService
        Verifies if given id is in UUID format
        Specified by:
        isUUID in interface CustomerService
        Parameters:
        id - the id
        Returns:
        true if UUID format
      • getCustomerByCustomerId

        public CustomerModel getCustomerByCustomerId​(java.lang.String customerId)
        Description copied from interface: CustomerService
        Gets the customer by customerId
        Specified by:
        getCustomerByCustomerId in interface CustomerService
        Parameters:
        customerId - the customerID in UUID format of the customer
        Returns:
        the found customer
      • getCustomerDao

        protected CustomerDao getCustomerDao()