2 * Copyright (C) 2016 - 2022 Free Software Foundation
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.
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.
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/>.
17 package org.mxchange.jfinancials.model.income.interval;
19 import java.io.Serializable;
22 * An enumeration for income/expenses intervals
24 * @author Roland Häder<roland@mxchange.org>
26 public enum FinancialInterval implements Serializable {
31 DAILY("FINANCIAL_INTERVAL_DAILY", "financial_interval_daily"), //NOI18N
36 WEEKLY("FINANCIAL_INTERVAL_WEEKLY", "financial_interval_weekly"), //NOI18N
41 MONTHLY("FINANCIAL_INTERVAL_MONTHLY", "financial_interval_monthly"), //NOI18N
46 YEARLY("FINANCIAL_INTERVAL_YEARLY", "financial_interval_yearly"); //NOI18N
51 private final String messageKey;
56 private final String styleClass;
59 * Constructor with i18n translation key and CSS style class
61 * @param messageKey Message key (i18n)
62 * @param styleClass CSS style class
64 private FinancialInterval (final String messageKey, final String styleClass) {
66 if (null == messageKey) {
68 throw new NullPointerException("messageKey is null"); //NOI18N
69 } else if (messageKey.isEmpty()) {
71 throw new IllegalArgumentException("messageKey is empty"); //NOI18N
72 } else if (null == styleClass) {
74 throw new NullPointerException("styleClass is null"); //NOI18N
75 } else if (styleClass.isEmpty()) {
77 throw new IllegalArgumentException("styleClass is empty"); //NOI18N
81 this.messageKey = messageKey;
82 this.styleClass = styleClass;
86 * Getter for message key
88 * @return Message key (i18n)
90 public String getMessageKey () {
91 return this.messageKey;
95 * Getter for CSS style class
97 * @return CSS style class
99 public String getStyleClass () {
100 return this.styleClass;