*/
package org.mxchange.pizzaapplication.beans.customer;
+import java.text.MessageFormat;
import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Event;
return "admin_list_customer"; //NOI18N
}
+ @Override
+ public void copyCustomerToController (final Customer customer) {
+ // Parameters must be valid
+ if (null == customer) {
+ // Throw NPE
+ throw new NullPointerException("customer is null");
+ } else if (customer.getCustomerId() == null) {
+ // Throw again ...
+ throw new NullPointerException("customer.customerId is null");
+ } else if (customer.getCustomerId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("customer.customerId={0} is not valid", customer.getCustomerId()));
+ } else if (customer.getCustomerContact() == null) {
+ // Throw NPE again
+ throw new NullPointerException("customer.customerContact is null");
+ } else if (customer.getCustomerContact().getContactId() == null) {
+ // .. and again
+ throw new NullPointerException("customer.customerContact.contactId is null");
+ } else if (customer.getCustomerContact().getContactId() < 1) {
+ // Invalid id
+ throw new IllegalArgumentException(MessageFormat.format("customer.customerContact.contactId={0} is not valid", customer.getCustomerContact().getContactId()));
+ }
+
+ // @TODO Set all data
+ }
+
/**
* Post-initialization of this class
*/