Coverage Report - org.kuali.rice.core.api.uif.RemotableCheckboxGroup
 
Classes in this File Line Coverage Branch Coverage Complexity
RemotableCheckboxGroup
88%
8/9
N/A
1.375
RemotableCheckboxGroup$1
N/A
N/A
1.375
RemotableCheckboxGroup$Builder
90%
10/11
100%
4/4
1.375
RemotableCheckboxGroup$Constants
0%
0/1
N/A
1.375
RemotableCheckboxGroup$Elements
0%
0/1
N/A
1.375
 
 1  
 package org.kuali.rice.core.api.uif;
 2  
 
 3  
 import org.kuali.rice.core.api.CoreConstants;
 4  
 import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
 5  
 import org.w3c.dom.Element;
 6  
 
 7  
 import javax.xml.bind.annotation.XmlAccessType;
 8  
 import javax.xml.bind.annotation.XmlAccessorType;
 9  
 import javax.xml.bind.annotation.XmlAnyElement;
 10  
 import javax.xml.bind.annotation.XmlElement;
 11  
 import javax.xml.bind.annotation.XmlRootElement;
 12  
 import javax.xml.bind.annotation.XmlType;
 13  
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 14  
 import java.util.Collection;
 15  
 import java.util.Collections;
 16  
 import java.util.HashMap;
 17  
 import java.util.Map;
 18  
 
 19  
 /**
 20  
  * A radio button group control type.
 21  
  */
 22  
 @XmlRootElement(name = RemotableCheckboxGroup.Constants.ROOT_ELEMENT_NAME)
 23  
 @XmlAccessorType(XmlAccessType.NONE)
 24  
 @XmlType(name = RemotableCheckboxGroup.Constants.TYPE_NAME, propOrder = {
 25  
                 RemotableCheckboxGroup.Elements.KEY_LABELS,
 26  
                 CoreConstants.CommonElements.FUTURE_ELEMENTS })
 27  3
 public final class RemotableCheckboxGroup extends RemotableAbstractControl implements KeyLabeled {
 28  
 
 29  
     @XmlElement(name = Elements.KEY_LABELS, required = true)
 30  
     @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 31  
     private final Map<String, String> keyLabels;
 32  
 
 33  5
     @SuppressWarnings("unused")
 34  
     @XmlAnyElement
 35  
     private final Collection<Element> _futureElements = null;
 36  
 
 37  
     /**
 38  
      * Should only be invoked by JAXB.
 39  
      */
 40  
     @SuppressWarnings("unused")
 41  2
     private RemotableCheckboxGroup() {
 42  2
         keyLabels = null;
 43  2
     }
 44  
 
 45  3
     private RemotableCheckboxGroup(Builder b) {
 46  3
         keyLabels = b.keyLabels;
 47  3
     }
 48  
 
 49  
     @Override
 50  
     public Map<String, String> getKeyLabels() {
 51  0
         return keyLabels;
 52  
     }
 53  
 
 54  6
     public static final class Builder extends RemotableAbstractControl.Builder implements KeyLabeled {
 55  
         private Map<String, String> keyLabels;
 56  
 
 57  5
         private Builder(Map<String, String> keyLabels) {
 58  5
             setKeyLabels(keyLabels);
 59  3
         }
 60  
 
 61  
         public static Builder create(Map<String, String> keyLabels) {
 62  5
             return new Builder(keyLabels);
 63  
         }
 64  
 
 65  
         @Override
 66  
         public Map<String, String> getKeyLabels() {
 67  0
             return keyLabels;
 68  
         }
 69  
 
 70  
         public void setKeyLabels(Map<String, String> keyLabels) {
 71  5
             if (keyLabels == null || keyLabels.isEmpty()) {
 72  2
                 throw new IllegalArgumentException("keyLabels must be non-null & non-empty");
 73  
             }
 74  
 
 75  3
             this.keyLabels = Collections.unmodifiableMap(new HashMap<String, String>(keyLabels));
 76  3
         }
 77  
 
 78  
         @Override
 79  
         public RemotableCheckboxGroup build() {
 80  3
             return new RemotableCheckboxGroup(this);
 81  
         }
 82  
     }
 83  
 
 84  
     /**
 85  
      * Defines some internal constants used on this class.
 86  
      */
 87  0
     static final class Constants {
 88  
         static final String TYPE_NAME = "CheckboxGroupType";
 89  
         final static String ROOT_ELEMENT_NAME = "checkboxGroup";
 90  
     }
 91  
 
 92  0
     static final class Elements {
 93  
         static final String KEY_LABELS = "keyLabels";
 94  
     }
 95  
 }