View Javadoc

1   /**
2    * Copyright 2012 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   *
15   * Created by vgadiyak on 6/12/12
16   */
17  package org.kuali.student.enrollment.class2.courseoffering.keyvalue;
18  
19  import org.kuali.rice.core.api.util.ConcreteKeyValue;
20  import org.kuali.rice.core.api.util.KeyValue;
21  import org.kuali.rice.krad.keyvalues.KeyValuesBase;
22  import org.kuali.student.enrollment.courseoffering.dto.WaitlistLevel;
23  
24  import java.io.Serializable;
25  import java.util.ArrayList;
26  import java.util.List;
27  
28  /**
29   * This class provides a key value finder for Waitlist levels
30   *
31   * @author Kuali Student Team
32   */
33  public class WaitlistLevelOptionsKeyValues extends KeyValuesBase implements Serializable {
34  
35      private static final long serialVersionUID = 1L;
36  
37      @Override
38      public List<KeyValue> getKeyValues() {
39  
40          List<KeyValue> keyValues = new ArrayList<KeyValue>();
41  
42          for (WaitlistLevel waitlistLevel : WaitlistLevel.values()) {
43              if (waitlistLevel.equals(WaitlistLevel.COURSE_OFFERING)) {
44                  keyValues.add(new ConcreteKeyValue(waitlistLevel.toString(), "Course Offering"));
45              } else if (waitlistLevel.equals(WaitlistLevel.ACTIVITY_OFFERING)) {
46                  keyValues.add(new ConcreteKeyValue(waitlistLevel.toString(), "Activity Offering"));
47              }
48          }
49  
50          return keyValues;
51      }
52  
53  }