1 /*
2 * Copyright 2012 The Kuali Foundation.
3 *
4 * Licensed under the Educational Community License, Version 1.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/ecl1.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.gl.businessobject.options;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.ole.gl.Constant;
22 import org.kuali.rice.core.api.util.ConcreteKeyValue;
23 import org.kuali.rice.core.api.util.KeyValue;
24 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
25 import org.kuali.rice.krad.valuefinder.ValueFinder;
26
27 /**
28 * Options finder for the options to include zero encumbrances on the open encumbrance lookup
29 */
30 public class ZeroEncumbranceOptionFinder extends KeyValuesBase implements ValueFinder {
31
32 /**
33 * Get the values: to include or exclude the zeroed out encumbrances
34 * @see org.kuali.rice.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues()
35 */
36 @Override
37 public List<KeyValue> getKeyValues() {
38 List<KeyValue> options = new ArrayList<KeyValue>();
39 options.add(new ConcreteKeyValue(Constant.ZERO_ENCUMBRANCE_INCLUDE, Constant.ZERO_ENCUMBRANCE_INCLUDE));
40 options.add(new ConcreteKeyValue(Constant.ZERO_ENCUMBRANCE_EXCLUDE, Constant.ZERO_ENCUMBRANCE_EXCLUDE));
41 return options;
42 }
43
44 /**
45 * Return the default value - which is to Exclude the zeroed out encumbrances
46 * @see org.kuali.rice.kns.lookup.valueFinder.ValueFinder#getValue()
47 */
48 @Override
49 public String getValue() {
50 return Constant.ZERO_ENCUMBRANCE_EXCLUDE;
51 }
52
53 }