From: Roland Häder Date: Tue, 19 Sep 2017 21:18:40 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f1ee584c899c681ab2595de0570b1ce9006fd3e2;p=jproduct-core.git Continued: - PaymentType entity now stores i18n key for easiy usage - maybe this fixes ClastCastException to java.lang.String? Signed-off-by: Roland Häder --- 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; + } }