Coverage Report - org.kuali.rice.kew.web.KeyValueSort
 
Classes in this File Line Coverage Branch Coverage Complexity
KeyValueSort
0%
0/22
0%
0/2
1.2
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  *
 4  
  *
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  * http://www.opensource.org/licenses/ecl2.php
 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,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.web;
 18  
 
 19  
 import org.apache.commons.lang.StringUtils;
 20  
 import org.kuali.rice.kew.docsearch.SearchableAttributeValue;
 21  
 
 22  
 
 23  
 
 24  
 /**
 25  
  * A simple bean for storing key/value pairs that can be used for a number of
 26  
  * tasks. Right now it is used to hold information that will be display on a jsp
 27  
  * for drop down boxes.
 28  
  *
 29  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 30  
  */
 31  
 public class KeyValueSort extends KeyValue {
 32  
 
 33  
         private static final long serialVersionUID = 3575440091286391804L;
 34  
 
 35  
         private String userDisplayValue;
 36  
         private Object sortValue;
 37  
     private Class sortClass;
 38  
     private SearchableAttributeValue searchableAttributeValue;
 39  
 
 40  
         public KeyValueSort() {
 41  0
                 super();
 42  0
         }
 43  
 
 44  
         public KeyValueSort(String key, String value) {
 45  0
                 super(key,value);
 46  0
         }
 47  
 
 48  
     public KeyValueSort(String key, String value, Object sortValue, SearchableAttributeValue searchableAttributeValue) {
 49  0
         super(key,value);
 50  0
         this.sortValue = sortValue;
 51  0
         this.searchableAttributeValue = searchableAttributeValue;
 52  0
     }
 53  
 
 54  
     public KeyValueSort(String key, String value, String userDisplayValue, Object sortValue, SearchableAttributeValue searchableAttributeValue) {
 55  0
             this(key,value,sortValue,searchableAttributeValue);
 56  0
         this.userDisplayValue = userDisplayValue;
 57  0
     }
 58  
 
 59  
     public KeyValueSort(KeyValueSort kvs) {
 60  0
         this(kvs.getkey(),kvs.getValue(),kvs.getUserDisplayValue(),kvs.getSortValue(),kvs.getSearchableAttributeValue());
 61  0
     }
 62  
 
 63  
         public Object getSortValue() {
 64  0
                 return sortValue;
 65  
         }
 66  
 
 67  
         public void setSortValue(Object sortValue) {
 68  0
                 this.sortValue = sortValue;
 69  0
         this.sortClass = sortValue.getClass();
 70  0
         }
 71  
 
 72  
     public Class getSortClass() {
 73  0
         return sortClass;
 74  
     }
 75  
 
 76  
     public SearchableAttributeValue getSearchableAttributeValue() {
 77  0
         return searchableAttributeValue;
 78  
     }
 79  
     
 80  
     public String getUserDisplayValue() {
 81  0
             if (StringUtils.isNotBlank(userDisplayValue)) {
 82  0
                     return userDisplayValue;
 83  
             }
 84  0
             return getValue();
 85  
     }
 86  
 
 87  
 }