]> git.mxchange.org Git - jcustomer-core.git/blob - src/org/mxchange/jcustomercore/model/customer/status/CustomerAccountStatus.java
Updated copyright year
[jcustomer-core.git] / src / org / mxchange / jcustomercore / model / customer / status / CustomerAccountStatus.java
1 /*
2  * Copyright (C) 2016 - 2022 Free Software Foundation
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.jcustomercore.model.customer.status;
18
19 import java.io.Serializable;
20
21 /**
22  * An enumeration for customer's account status like confirmed, locked, etc.
23  * <p>
24  * @author Roland Häder<roland@mxchange.org>
25  */
26 public enum CustomerAccountStatus implements Serializable {
27
28         /**
29          * Unconfirmed (default)
30          */
31         UNCONFIRMED("CUSTOMER_ACCOUNT_STATUS_UNCONFIRMED", "customer-status-unconfirmed"), //NOI18N
32
33         /**
34          * Confirmed (email address validated)
35          */
36         CONFIRMED("CUSTOMER_ACCOUNT_STATUS_CONFIRMED", "customer-status-confirmed"), //NOI18N
37
38         /**
39          * Locked (maybe violated T&C)
40          */
41         LOCKED("CUSTOMER_ACCOUNT_STATUS_LOCKED", "customer-status-locked"); //NOI18N
42
43         /**
44          * Message key
45          */
46         private final String messageKey;
47
48         /**
49          * CSS style class
50          */
51         private final String styleClass;
52
53         /**
54          * Constructor with i18n translation key
55          * <p>
56          * @param messageKey Message key (i18n)
57          * @param styleClass CSS style class
58          */
59         private CustomerAccountStatus (final String messageKey, final String styleClass) {
60                 // Validate parameter
61                 if (null == messageKey) {
62                         // Throw NPE
63                         throw new NullPointerException("messageKey is null"); //NOI18N
64                 } else if (messageKey.isEmpty()) {
65                         // Throw IAE
66                         throw new IllegalArgumentException("messageKey is empty"); //NOI18N
67                 } else if (null == styleClass) {
68                         // Throw NPE
69                         throw new NullPointerException("styleClass is null"); //NOI18N
70                 } else if (styleClass.isEmpty()) {
71                         // Throw IAE
72                         throw new IllegalArgumentException("styleClass is empty"); //NOI18N
73                 }
74
75                 // Set it here
76                 this.messageKey = messageKey;
77                 this.styleClass = styleClass;
78         }
79
80         /**
81          * Output value (for messages)
82          * <p>
83          * @return the messageKey
84          */
85         public String getMessageKey () {
86                 return this.messageKey;
87         }
88
89         /**
90          * Getter for CSS style class
91          * <p>
92          * @return CSS style class
93          */
94         public String getStyleClass () {
95                 return this.styleClass;
96         }
97
98 }