]> git.mxchange.org Git - jproduct-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 19 Sep 2017 21:18:40 +0000 (23:18 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 19 Sep 2017 21:20:40 +0000 (23:20 +0200)
- PaymentType entity now stores i18n key for easiy usage
- maybe this fixes ClastCastException to java.lang.String?

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jproduct/model/payment/PaymentType.java

index c9b3303c7ee00bc27ae24e8d122e6033fbb79b72..1ce7ef625421b26f105236d46a52a64affb34807 100644 (file)
@@ -26,18 +26,46 @@ public enum PaymentType {
        /**
         * Payment type "cash"
         */
-       PAYMENT_TYPE_CASH,
+       PAYMENT_TYPE_CASH("PAYMENT_TYPE_CASH"),
        /**
         * Payment type "credit card"
         */
-       PAYMENT_TYPE_CREDIT_CARD,
+       PAYMENT_TYPE_CREDIT_CARD("PAYMENT_TYPE_CREDIT_CARD"),
+       /**
+        * Payment type "debit card"
+        */
+       PAYMENT_TYPE_DEBIT_CARD("PAYMENT_TYPE_DEBIT_CARD"),
        /**
         * Payment type "prepayment"
         */
-       PAYMENT_TYPE_PREPAYMENT,
+       PAYMENT_TYPE_PREPAYMENT("PAYMENT_TYPE_PREPAYMENT"),
        /**
         * Payment type "invoice"
         */
-       PAYMENT_TYPE_INVOICE;
+       PAYMENT_TYPE_INVOICE("PAYMENT_TYPE_INVOICE");
+
+       /**
+        * I18n key
+        */
+       private final String i18nKey;
+
+       /**
+        * Constructor with i18n key
+        * <p>
+        * @param i18Key I18n key
+        */
+       private PaymentType (final String i18Key) {
+               // Set both here
+               this.i18nKey = i18Key;
+       }
+
+       /**
+        * Getter for i18n key
+        * <p>
+        * @return I18n key
+        */
+       public String getI18nKey () {
+               return this.i18nKey;
+       }
 
 }