View Javadoc
1   /*
2    * MoneyWise: Finance Application
3    * Copyright 2012-2026. Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6    * use this file except in compliance with the License.  You may obtain a copy
7    * of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14   * License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  package io.github.tonywasher.joceanus.moneywise.atlas.data.analysis.values;
18  
19  import io.github.tonywasher.joceanus.metis.data.MetisDataType;
20  import io.github.tonywasher.joceanus.moneywise.atlas.data.analysis.base.MoneyWiseXAnalysisAttribute;
21  
22  /**
23   * PayeeAttribute enumeration.
24   */
25  public enum MoneyWiseXAnalysisPayeeAttr
26          implements MoneyWiseXAnalysisAttribute {
27      /**
28       * Income.
29       */
30      INCOME,
31  
32      /**
33       * Expense.
34       */
35      EXPENSE,
36  
37      /**
38       * Profit (NetIncome).
39       */
40      PROFIT;
41  
42      /**
43       * The String name.
44       */
45      private String theName;
46  
47      @Override
48      public String toString() {
49          /* If we have not yet loaded the name */
50          if (theName == null) {
51              /* Load the name */
52              theName = MoneyWiseXAnalysisValuesResource.getKeyForPayeeAttr(this).getValue();
53          }
54  
55          /* return the name */
56          return theName;
57      }
58  
59      @Override
60      public boolean isPreserved() {
61          return true;
62      }
63  
64      @Override
65      public MetisDataType getDataType() {
66          return MetisDataType.MONEY;
67      }
68  }