View Javadoc
1   /*
2    * Copyright 2008 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.module.purap.util;
17  
18  import org.apache.commons.lang.enums.Enum;
19  import org.kuali.ole.module.purap.PurapPropertyConstants;
20  
21  import java.util.Iterator;
22  import java.util.List;
23  import java.util.Map;
24  
25  public final class ThresholdField extends Enum {
26  
27      public static final ThresholdField CHART_OF_ACCOUNTS_CODE = new ThresholdField(PurapPropertyConstants.CHART_OF_ACCOUNTS_CODE);
28      public static final ThresholdField ORGANIZATION_CODE = new ThresholdField(PurapPropertyConstants.ORGANIZATION_CODE);
29      public static final ThresholdField ACCOUNT_TYPE_CODE = new ThresholdField(PurapPropertyConstants.ACCOUNT_TYPE_CODE);
30      public static final ThresholdField SUBFUND_GROUP_CODE = new ThresholdField(PurapPropertyConstants.SUB_FUND_GROUP_CODE);
31      public static final ThresholdField FINANCIAL_OBJECT_CODE = new ThresholdField(PurapPropertyConstants.FINANCIAL_OBJECT_CODE);
32      public static final ThresholdField COMMODITY_CODE = new ThresholdField(PurapPropertyConstants.ITEM_COMMODITY_CODE);
33      public static final ThresholdField VENDOR_HEADER_GENERATED_ID = new ThresholdField(PurapPropertyConstants.VENDOR_HEADER_GENERATED_ID);
34      public static final ThresholdField VENDOR_DETAIL_ASSIGNED_ID = new ThresholdField(PurapPropertyConstants.VENDOR_DETAIL_ASSIGNED_ID);
35      public static final ThresholdField VENDOR_NUMBER = new ThresholdField(PurapPropertyConstants.VENDOR_NUMBER, false);
36      public static final ThresholdField ACTIVE = new ThresholdField(PurapPropertyConstants.BO_ACTIVE, true);
37  
38      /**
39       * Indicates that a field is available in DB or not
40       */
41      private boolean isPersistedField;
42  
43      private ThresholdField(String name) {
44          this(name, true);
45      }
46  
47      private ThresholdField(String name,
48                             boolean isPersisitedField) {
49          super(name);
50          this.isPersistedField = isPersisitedField;
51      }
52  
53      public static ThresholdField getEnum(String thresholdEnum) {
54          return (ThresholdField) getEnum(ThresholdField.class, thresholdEnum);
55      }
56  
57      public static Map getEnumMap() {
58          return getEnumMap(ThresholdField.class);
59      }
60  
61      public static List getEnumList() {
62          return getEnumList(ThresholdField.class);
63      }
64  
65      public static Iterator iterator() {
66          return iterator(ThresholdField.class);
67      }
68  
69      public boolean isPersistedField() {
70          return isPersistedField;
71      }
72  }