From f1ee584c899c681ab2595de0570b1ce9006fd3e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 19 Sep 2017 23:18:40 +0200 Subject: [PATCH] Continued: - PaymentType entity now stores i18n key for easiy usage - maybe this fixes ClastCastException to java.lang.String? MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../jproduct/model/payment/PaymentType.java | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/org/mxchange/jproduct/model/payment/PaymentType.java b/src/org/mxchange/jproduct/model/payment/PaymentType.java index c9b3303..1ce7ef6 100644 --- a/src/org/mxchange/jproduct/model/payment/PaymentType.java +++ b/src/org/mxchange/jproduct/model/payment/PaymentType.java @@ -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 + *

+ * @param i18Key I18n key + */ + private PaymentType (final String i18Key) { + // Set both here + this.i18nKey = i18Key; + } + + /** + * Getter for i18n key + *

+ * @return I18n key + */ + public String getI18nKey () { + return this.i18nKey; + } } -- 2.39.5