]> git.mxchange.org Git - jcore.git/blob - src/org/mxchange/jcore/contact/Gender.java
Don't do this, having chars for database keys, you can directly use the enum name...
[jcore.git] / src / org / mxchange / jcore / contact / Gender.java
1 /*
2  * Copyright (C) 2015 Roland Haeder
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.jcore.contact;
18
19 import org.mxchange.jcore.BaseFrameworkSystem;
20
21 /**
22  * Gender enum
23  *
24  * @author Roland Haeder
25  */
26 public enum Gender {
27
28         /**
29          * Unknown enum
30          */
31         UNKNOWN("BaseContact.gender.unknown.text"),
32         /**
33          * Male enum
34          */
35         MALE("BaseContact.gender.male.text"),
36         /**
37          * Female enum
38          */
39         FEMALE("BaseContact.gender.female.text"),
40         /**
41          * Company enum
42          */
43         COMPANY("BaseContact.gender.company.text");
44
45         /**
46          * Output value (for messages)
47          */
48         private final String messageKey;
49
50         /**
51          * Constructor
52          *
53          * @param messageKey Message key for resource file
54          */
55         private Gender (final String messageKey) {
56                 this.messageKey = messageKey;
57         }
58
59         /**
60          * Output value (for messages)
61          *
62          * @return the messageKey
63          */
64         public String getMessageKey () {
65                 return this.messageKey;
66         }
67
68         /**
69          * Overwritten to return human-readable strings
70          *
71          * @return Human-readable strings
72          */
73         @Override
74         public String toString () {
75                 // Get key from bundle and return it
76                 return BaseFrameworkSystem.getInstance().getMessageStringFromKey(this.getMessageKey());
77         }
78 }