Coverage Report - org.kuali.rice.core.api.util.jaxb.StringMapEntry
 
Classes in this File Line Coverage Branch Coverage Complexity
StringMapEntry
71%
10/14
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007-2010 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.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.rice.core.api.util.jaxb;
 17  
 
 18  
 import javax.xml.bind.annotation.XmlAccessType;
 19  
 import javax.xml.bind.annotation.XmlAccessorType;
 20  
 import javax.xml.bind.annotation.XmlAttribute;
 21  
 import javax.xml.bind.annotation.XmlType;
 22  
 import javax.xml.bind.annotation.XmlValue;
 23  
 import java.io.Serializable;
 24  
 import java.util.Map;
 25  
 
 26  
 /**
 27  
  * Single String-String key-value pair for 
 28  
  * marshalling/unmarshalling. Need this rather than
 29  
  * general Map.Entry<String, String> to specify
 30  
  * cardinality in resulting wsdl's.
 31  
  * 
 32  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 33  
  *
 34  
  */
 35  
 @XmlAccessorType(XmlAccessType.NONE)
 36  
 @XmlType(name = "StringMapEntryType")
 37  
 public final class StringMapEntry implements Serializable {
 38  
         
 39  
         private static final long serialVersionUID = -9609663434312103L;
 40  
 
 41  
         @XmlAttribute (name = "key")
 42  
         private final String key;
 43  
         
 44  
         @XmlValue
 45  
         private final String value;
 46  
         
 47  
         /**
 48  
          * Used only by JAXB.
 49  
          */
 50  
         @SuppressWarnings("unused")
 51  20
         private StringMapEntry() {
 52  20
                 this.key = null;
 53  20
                 this.value = null;
 54  20
         }
 55  
         
 56  0
         public StringMapEntry(String key, String value) {
 57  0
             this.key = key;
 58  0
             this.value = value;
 59  0
         }
 60  
 
 61  10
         public StringMapEntry(Map.Entry<String, String> e) {
 62  10
             this.key = e.getKey();
 63  10
             this.value = e.getValue();
 64  10
         }
 65  
 
 66  
         public String getKey() {
 67  20
                 return this.key;
 68  
         }
 69  
 
 70  
         public String getValue() {
 71  20
                 return this.value;
 72  
         }
 73  
         
 74  
 }