From 3c20a10b2675eed767e7d900980a514c39e3c397 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 25 Sep 2015 12:39:37 +0200 Subject: [PATCH] =?utf8?q?added=20a=20new=20enum=20for=20account=20status?= =?utf8?q?=20+=20updated=20jars=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcore.jar | Bin 31990 -> 32202 bytes lib/jcoreee.jar | Bin 17745 -> 17745 bytes .../jshopcore/model/customer/Customer.java | 5 +- .../model/customer/ShopCustomer.java | 15 ++-- .../status/CustomerAccountStatus.java | 65 ++++++++++++++++++ 5 files changed, 76 insertions(+), 9 deletions(-) create mode 100644 src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java diff --git a/lib/jcore.jar b/lib/jcore.jar index 2223e57f31b8a3d8f755f4d75191b1e49172076b..2fbc389b088701ec28613e7e931fe31f222d2639 100644 GIT binary patch delta 6889 zcmbtZd0bT275?tbz11oRW;I=66T3HU(5<5c$PJyP_0Pm~-_{Lc9jR>^Ul^&)?(1rIcXj60 z?kr25o>!8Wzpl9C$eDCItGqnP=swHfPNs`IqhBe?jQ$2uWc24msnJK+ibs=NJsJ1? zrOV+N%cQfZrNaO8kd7T5y*juo4wo&YsiuJ z+MDO(;AVclg`RP%hHTu%)G-aW<2b*#L&Z0lbEkq6D(=!S1>aKfZI(RA{JT}$qj+l^ zO{zQ{mm+_ouauiJV`OFc7;j!=hfT?W27z4fjiZLbBhw#7#>2?WdJxK(EIBFmGLbF! z#-=f5@5xw?%^OQ~0CI)h4kl z`&Z$HR$f7^h~(jD*#1iI*)ZU&+&!aGt5Q&*V3vYPd0lmdR}?;Gs~DS+xnNWK_V#J6 z_TKJkEj?TN+~opM{ax;ctpojCO#@rjcl8OxWLzSZx!n6galFlw4LAgiORmx9VVcqB z!)f%>5oz=V*7FSOxey5kzX(Z2UyN}^UxM*QKNF=i{Q_mw+E6|s3F~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YmfbH^R+w|CL1V*>EbagXJLS{nc(&|NtDhAEa zlr!6>%d!pm^6Knd*Td~c93o#fcD_HrQLvJ(2@2@l3ZzwB2)@k=Kos4f6jJno;?KHz zuzIFZiz9P99AA@20NppLC>9jE7qH?Sso?NaFq3>w;QFbr**6J)--DTCVIa7~me_cRvAcYBWxjzDBK$oz2;v zy1XUms?&a0;!|6qt+#PqLwj@6w~CJCdr|9Q*=Sk1DKh=rY{d_;(~Ehkw1)ZR{P9MZ zmyF!i6CUs~NhbwI4R~C5fb&3fectC4=i&ZTaBd7-e6i*}Z*2xUB6BH+76DKYOx@;);JcLkg%q zFc=pl8+sDu{@yqf(s7bM9Bp=e)thL_9{u?9kJ>3F_{V$N&~sq$wpi29V?ve7`(jP` z{=OKcHqq=}T^TBm^@W?=C#d^i5_j+JFE)Eh`eT&WldYZ*xvk&&pW_kgO-!L)%e#Ni z3Xz}nTT{3_N*WW6e{-D)v=-pA*TV6G`LnI9<{BX8Vlt>f_bopX!f l=fL3YD~Q=CYqwd9BX;OvKAP#L&BT}^4{nPIa(3~^{{fi7zBvE@ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 37a902e7e287344bf9e0d02609a517bc832822dc..648886a7db3c89adffaf81a8a240feabc2ae530a 100644 GIT binary patch delta 333 zcmccE#dxuckte{LnT3mifrEkJVah}vO{NDa6V0bH0ofN6K;$P)AURo<(GWxhFj|AC zUPcEHb)L}=M9DKbL3oCf1DMz+>GGf$36wURyv~Jv@@pn8kh1Sg9zbfdBXckdh@QrN zmIFkm3QXbw(LZI>SV6R+(tb`5{Yd)_SltDKMzFeI%YPvLY-yW lh%$3Z0a0_DvOpAvb0diAcFqJ*-<-=qRK80#h`Qra3ILF@f205a delta 333 zcmccE#dxuckte{LnT3mifrEj;H+mwECX-L}MDyuPK=uU%5cx?HNKTezGz3urjMgBk zm(c-4ooDm|QSwYq5T4=W04DZHx;!XG0;LTnuXACa{F;dir0hGB2awwA$Q;Z9qNlN+ z#C|i3+5Y=Gs4WiE42Y@Jfhd2;b?+^sx$xMFl0Cso1gUn=qM>CLUyJG~1dgvGo lqRgC9K-3(kED*)v+z6t&oijnyH|KH?mG6=bqVBkq0sv~&XB+?k diff --git a/src/org/mxchange/jshopcore/model/customer/Customer.java b/src/org/mxchange/jshopcore/model/customer/Customer.java index cbfe426..ffb8354 100644 --- a/src/org/mxchange/jshopcore/model/customer/Customer.java +++ b/src/org/mxchange/jshopcore/model/customer/Customer.java @@ -19,6 +19,7 @@ package org.mxchange.jshopcore.model.customer; import java.io.Serializable; import java.util.Calendar; import org.mxchange.jcore.model.contact.Contact; +import org.mxchange.jshopcore.model.customer.status.CustomerAccountStatus; /** * A customer interface @@ -137,12 +138,12 @@ public interface Customer extends Serializable { * * @return Account status */ - public String getCustomerStatus (); + public CustomerAccountStatus getCustomerAccountStatus (); /** * Setter for account status * * @param customerStatus Account status */ - public void setCustomerStatus (final String customerStatus); + public void setCustomerAccountStatus (final CustomerAccountStatus customerStatus); } diff --git a/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java b/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java index 7544264..3ea4c9c 100644 --- a/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java +++ b/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java @@ -30,6 +30,7 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.mxchange.jcore.model.contact.Contact; import org.mxchange.jcore.model.contact.UserContact; +import org.mxchange.jshopcore.model.customer.status.CustomerAccountStatus; /** * A shop customer class. @@ -97,8 +98,8 @@ public class ShopCustomer implements Customer { * Account status */ @Basic (optional = false) - @Column (name = "customer_status", nullable = false) - private String customerStatus; + @Column (name = "customer_account_status", nullable = false) + private CustomerAccountStatus customerAccountStatus; /** * Default constructor @@ -115,7 +116,7 @@ public class ShopCustomer implements Customer { this.setCustomerConfirmKey(customer.getCustomerConfirmKey()); this.setCustomerNumber(customer.getCustomerNumber()); this.setCustomerPasswordHash(customer.getCustomerPasswordHash()); - this.setCustomerStatus(customer.getCustomerStatus()); + this.setCustomerAccountStatus(customer.getCustomerAccountStatus()); this.setCustomerCreated(customer.getCustomerCreated()); this.setCustomerLocked(customer.getCustomerLocked()); } @@ -191,12 +192,12 @@ public class ShopCustomer implements Customer { } @Override - public String getCustomerStatus () { - return this.customerStatus; + public CustomerAccountStatus getCustomerAccountStatus () { + return this.customerAccountStatus; } @Override - public void setCustomerStatus (final String customerStatus) { - this.customerStatus = customerStatus; + public void setCustomerAccountStatus (final CustomerAccountStatus customerAccountStatus) { + this.customerAccountStatus = customerAccountStatus; } } diff --git a/src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java b/src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java new file mode 100644 index 0000000..5b41557 --- /dev/null +++ b/src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jshopcore.model.customer.status; + +import java.io.Serializable; + +/** + * An enum for customer's account status like confirmed, locked, etc. + * + * @author Roland Haeder + */ +public enum CustomerAccountStatus implements Serializable { + /** + * Unconfirmed (default) + */ + UNCONFIRMED("CUSTOMER_ACCOUNT_STATUS_UNCONFIRMED"), //NOI18N + + /** + * Confirmed (email address validated) + */ + CONFIRMED("CUSTOMER_ACCOUNT_STATUS_CONFIRMED"), //NOI18N + + /** + * Locked (maybe violeted T&C) + */ + LOCKED("CUSTOMER_ACCOUNT_STATUS_LOCKED"); //NOI18N + + /** + * Message key + */ + private final String messageKey; + + /** + * Constructor with i18n translation key + * + * @param messageKey Message key (i18n) + */ + private CustomerAccountStatus (final String messageKey) { + // Set it here + this.messageKey = messageKey; + } + + /** + * Output value (for messages) + * + * @return the messageKey + */ + public String getMessageKey () { + return this.messageKey; + } +} -- 2.39.5