Coverage Report - javax.faces.model.SelectItem
 
Classes in this File Line Coverage Branch Coverage Complexity
SelectItem
87%
34/39
N/A
1
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
 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,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package javax.faces.model;
 17  
 
 18  
 import java.io.Serializable;
 19  
 
 20  
 import org.seasar.framework.util.AssertionUtil;
 21  
 
 22  
 /**
 23  
  * @author shot
 24  
  * @author manhole
 25  
  */
 26  
 public class SelectItem implements Serializable {
 27  
 
 28  
     private static final long serialVersionUID = 1L;
 29  
 
 30  229
     private Object value = null;
 31  
 
 32  229
     private String label = null;
 33  
 
 34  229
     private String description = null;
 35  
 
 36  229
     private boolean disabled = false;
 37  
 
 38  179
     public SelectItem() {
 39  179
     }
 40  
 
 41  1
     public SelectItem(Object value) {
 42  1
         AssertionUtil.assertNotNull("value", value);
 43  0
         this.value = value;
 44  0
         this.label = value.toString();
 45  0
         this.description = null;
 46  0
         this.disabled = false;
 47  0
     }
 48  
 
 49  
     public SelectItem(Object value, String label) {
 50  24
         this(value, label, null);
 51  21
     }
 52  
 
 53  
     public SelectItem(Object value, String label, String description) {
 54  33
         this(value, label, description, false);
 55  28
     }
 56  
 
 57  
     public SelectItem(Object value, String label, String description,
 58  49
             boolean disabled) {
 59  49
         AssertionUtil.assertNotNull("value", value);
 60  46
         AssertionUtil.assertNotNull("label", label);
 61  41
         this.value = value;
 62  41
         this.label = label;
 63  41
         this.description = description;
 64  41
         this.disabled = disabled;
 65  41
     }
 66  
 
 67  
     public String getDescription() {
 68  11
         return description;
 69  
     }
 70  
 
 71  
     public void setDescription(String description) {
 72  171
         this.description = description;
 73  171
     }
 74  
 
 75  
     public boolean isDisabled() {
 76  214
         return disabled;
 77  
     }
 78  
 
 79  
     public void setDisabled(boolean disabled) {
 80  169
         this.disabled = disabled;
 81  169
     }
 82  
 
 83  
     public String getLabel() {
 84  154
         return label;
 85  
     }
 86  
 
 87  
     public void setLabel(String label) {
 88  173
         AssertionUtil.assertNotNull("label", label);
 89  172
         this.label = label;
 90  172
     }
 91  
 
 92  
     public Object getValue() {
 93  169
         return value;
 94  
     }
 95  
 
 96  
     public void setValue(Object value) {
 97  174
         AssertionUtil.assertNotNull("value", value);
 98  173
         this.value = value;
 99  173
     }
 100  
 
 101  
 }