/**
* I18n key
*/
- private final String i18nKey;
+ private final String messageKey;
/**
* Constructor with i18n key
* <p>
- * @param i18Key I18n key
+ * @param messageKey I18n key
*/
- private PaymentType (final String i18Key) {
+ private PaymentType (final String messageKey) {
+ // Validate parameter
+ if (null == messageKey) {
+ // Throw NPE
+ throw new NullPointerException("messageKey is null"); //NOI18N
+ } else if (messageKey.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("messageKey is empty"); //NOI18N
+ }
+
// Set both here
- this.i18nKey = i18Key;
+ this.messageKey = messageKey;
}
/**
* <p>
* @return I18n key
*/
- public String getI18nKey () {
- return this.i18nKey;
+ public String getMessageKey () {
+ return this.messageKey;
}
}
/**
* Age group "senior"
*/
- AGE_GROUP_SENIOR("AGE_GROUP_SENIOR"); //NOI18N
+ AGE_GROUP_SENIOR("AGE_GROUP_SENIOR"); //NOI18N//NOI18N
/**
* I18n key for age group/class
*/
- private final String i18nKey;
+ private final String messageKey;
/**
* Constructor with all enumeration fields
* <p>
- * @param i18nKey I18n key for age class
+ * @param messageKey I18n key for age class
*/
- private AgeGroup (final String i18nKey) {
+ private AgeGroup (final String messageKey) {
+ // Validate parameter
+ if (null == messageKey) {
+ // Throw NPE
+ throw new NullPointerException("messageKey is null"); //NOI18N
+ } else if (messageKey.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("messageKey is empty"); //NOI18N
+ }
+
// Set all values
- this.i18nKey = i18nKey;
+ this.messageKey = messageKey;
}
/**
* <p>
* @return Age group's i18n key
*/
- public String getI18nKey () {
- return this.i18nKey;
+ public String getMessageKey () {
+ return this.messageKey;
}
}