From 5268d45b0d65ad3de69ff51fa6f6257779973bc1 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 4 Sep 2015 20:31:38 +0200 Subject: [PATCH] =?utf8?q?Renamed=20methods=20and=20instance=20and=20used?= =?utf8?q?=20Customer=20interface,=20so=20the=20bean=20doesn't=20"see"=20i?= =?utf8?q?t=20is=20actually=20a=20Contact=20Signed-off-by:Roland=20H=C3=A4?= =?utf8?q?der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../beans/customer/CustomerWebBean.java | 7 -- .../customer/PizzaServiceCustomerWebBean.java | 92 +++++++++---------- 2 files changed, 43 insertions(+), 56 deletions(-) diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java index 01a603b3..13e9c27a 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/CustomerWebBean.java @@ -249,11 +249,4 @@ public interface CustomerWebBean extends FrameworkBean { * @return Own data? */ public boolean isOwnContact (); - - /** - * Shows the contact to the user - * - * @param client Client instance to call back - */ - public void show (final Client client); } diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java index 116ef539..c7f873d3 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaServiceCustomerWebBean.java @@ -18,10 +18,9 @@ package org.mxchange.pizzaapplication.beans.customer; import javax.enterprise.context.SessionScoped; import javax.inject.Named; -import org.mxchange.jcore.client.Client; -import org.mxchange.jcore.contact.Contact; import org.mxchange.jcore.contact.gender.Gender; import org.mxchange.jshop.beans.BaseFrameworkBean; +import org.mxchange.jshop.model.customer.Customer; import org.mxchange.jshop.model.customer.ShopCustomer; /** @@ -38,103 +37,103 @@ public class PizzaServiceCustomerWebBean extends BaseFrameworkBean implements Cu private static final long serialVersionUID = 542145347916L; /** - * Contact instance + * Customer instance */ - private Contact contact; + private Customer customer; /** * Default constructor */ public PizzaServiceCustomerWebBean () { // Instance customer - Contact customer = new ShopCustomer(); + Customer customer = new ShopCustomer(); // And set it here - this.setContact(customer); + this.setCustomer(customer); } @Override public String getBirthday () { // Deligate to "hidden" object - return this.getContact().getBirthday(); + return this.getCustomer().getBirthday(); } @Override public void setBirthday (final String birthday) { // Deligate to "hidden" object - this.getContact().setBirthday(birthday); + this.getCustomer().setBirthday(birthday); } @Override public String getCellphoneNumber () { // Deligate to "hidden" object - return this.getContact().getCellphoneNumber(); + return this.getCustomer().getCellphoneNumber(); } @Override public void setCellphoneNumber (final String cellphoneNumber) { // Deligate to "hidden" object - this.getContact().setCellphoneNumber(cellphoneNumber); + this.getCustomer().setCellphoneNumber(cellphoneNumber); } @Override public String getCity () { // Deligate to "hidden" object - return this.getContact().getCity(); + return this.getCustomer().getCity(); } @Override public void setCity (final String city) { // Deligate to "hidden" object - this.getContact().setCity(city); + this.getCustomer().setCity(city); } @Override public String getComment () { // Deligate to "hidden" object - return this.getContact().getComment(); + return this.getCustomer().getComment(); } @Override public void setComment (final String comment) { // Deligate to "hidden" object - this.getContact().setComment(comment); + this.getCustomer().setComment(comment); } @Override public String getCompanyName () { // Deligate to "hidden" object - return this.getContact().getCompanyName(); + return this.getCustomer().getCompanyName(); } @Override public void setCompanyName (final String companyName) { // Deligate to "hidden" object - this.getContact().setCompanyName(companyName); + this.getCustomer().setCompanyName(companyName); } @Override public String getCountryCode () { // Deligate to "hidden" object - return this.getContact().getCountryCode(); + return this.getCustomer().getCountryCode(); } @Override public void setCountryCode (final String countryCode) { // Deligate to "hidden" object - this.getContact().setCountryCode(countryCode); + this.getCustomer().setCountryCode(countryCode); } @Override public String getEmailAddress () { // Deligate to "hidden" object - return this.getContact().getEmailAddress(); + return this.getCustomer().getEmailAddress(); } @Override public void setEmailAddress (final String emailAddress) { // Deligate to "hidden" object - this.getContact().setEmailAddress(emailAddress); + this.getCustomer().setEmailAddress(emailAddress); } @Override @@ -143,7 +142,7 @@ public class PizzaServiceCustomerWebBean extends BaseFrameworkBean implements Cu //* NOISY-DEBUG: */ this.getLogger().trace("CALLED!"); // Deligate to "hidden" object - return this.getContact().getFamilyName(); + return this.getCustomer().getFamilyName(); } @Override @@ -152,97 +151,97 @@ public class PizzaServiceCustomerWebBean extends BaseFrameworkBean implements Cu //* NOISY-DEBUG: */ this.getLogger().trace(MessageFormat.format("familyName={0} - CALLED!", familyName)); // Deligate to "hidden" object - this.getContact().setFamilyName(familyName); + this.getCustomer().setFamilyName(familyName); } @Override public String getFaxNumber () { // Deligate to "hidden" object - return this.getContact().getFaxNumber(); + return this.getCustomer().getFaxNumber(); } @Override public void setFaxNumber (final String faxNumber) { // Deligate to "hidden" object - this.getContact().setFaxNumber(faxNumber); + this.getCustomer().setFaxNumber(faxNumber); } @Override public Gender getGender () { // Deligate to "hidden" object - return this.getContact().getGender(); + return this.getCustomer().getGender(); } @Override public void setGender (final Gender gender) { // Deligate to "hidden" object - this.getContact().setGender(gender); + this.getCustomer().setGender(gender); } @Override public Long getHouseNumber () { // Deligate to "hidden" object - return this.getContact().getHouseNumber(); + return this.getCustomer().getHouseNumber(); } @Override public void setHouseNumber (final Long houseNumber) { // Deligate to "hidden" object - this.getContact().setHouseNumber(houseNumber); + this.getCustomer().setHouseNumber(houseNumber); } @Override public String getPhoneNumber () { // Deligate to "hidden" object - return this.getContact().getPhoneNumber(); + return this.getCustomer().getPhoneNumber(); } @Override public void setPhoneNumber (final String phoneNumber) { // Deligate to "hidden" object - this.getContact().setPhoneNumber(phoneNumber); + this.getCustomer().setPhoneNumber(phoneNumber); } @Override public String getStreet () { // Deligate to "hidden" object - return this.getContact().getStreet(); + return this.getCustomer().getStreet(); } @Override public void setStreet (final String street) { // Deligate to "hidden" object - this.getContact().setStreet(street); + this.getCustomer().setStreet(street); } @Override public String getFirstName () { // Deligate to "hidden" object - return this.getContact().getFirstName(); + return this.getCustomer().getFirstName(); } @Override public void setFirstName (final String firstName) { // Deligate to "hidden" object - this.getContact().setFirstName(firstName); + this.getCustomer().setFirstName(firstName); } @Override public String getTranslatedGender () { // Deligate to "hidden" object - return this.getContact().getTranslatedGender(); + return this.getCustomer().getTranslatedGender(); } @Override public Long getZipCode () { // Deligate to "hidden" object - return this.getContact().getZipCode(); + return this.getCustomer().getZipCode(); } @Override public void setZipCode (final Long zipCode) { // Deligate to "hidden" object - this.getContact().setZipCode(zipCode); + this.getCustomer().setZipCode(zipCode); } @Override @@ -250,24 +249,19 @@ public class PizzaServiceCustomerWebBean extends BaseFrameworkBean implements Cu throw new UnsupportedOperationException("Not supported yet."); //NOI18N } - @Override - public void show (final Client client) { - throw new UnsupportedOperationException("Not supported yet."); //NOI18N - } - /** - * Setter for Contact instance - * @param contact Contact instance to set + * Setter for Customer instance + * @param customer Contact instance to set */ - private void setContact (final Contact contact) { - this.contact = contact; + private void setCustomer (final Customer customer) { + this.customer = customer; } /** - * Getter for Contact instance + * Getter for Customer instance * @return Contact instance */ - private Contact getContact () { - return this.contact; + private Customer getCustomer () { + return this.customer; } } -- 2.39.5