Coverage Report - org.kuali.rice.krms.api.repository.agenda.AgendaTreeSubAgendaEntry
 
Classes in this File Line Coverage Branch Coverage Complexity
AgendaTreeSubAgendaEntry
73%
11/15
N/A
1.286
AgendaTreeSubAgendaEntry$1
N/A
N/A
1.286
AgendaTreeSubAgendaEntry$Builder
88%
15/17
50%
2/4
1.286
AgendaTreeSubAgendaEntry$Constants
50%
1/2
N/A
1.286
AgendaTreeSubAgendaEntry$Elements
0%
0/1
N/A
1.286
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.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/ecl1.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.krms.api.repository.agenda;
 17  
 
 18  
 import java.io.Serializable;
 19  
 import java.util.Collection;
 20  
 
 21  
 import javax.xml.bind.annotation.XmlAccessType;
 22  
 import javax.xml.bind.annotation.XmlAccessorType;
 23  
 import javax.xml.bind.annotation.XmlAnyElement;
 24  
 import javax.xml.bind.annotation.XmlElement;
 25  
 import javax.xml.bind.annotation.XmlRootElement;
 26  
 import javax.xml.bind.annotation.XmlType;
 27  
 
 28  
 import org.apache.commons.lang.builder.EqualsBuilder;
 29  
 import org.apache.commons.lang.builder.HashCodeBuilder;
 30  
 import org.apache.commons.lang.builder.ToStringBuilder;
 31  
 import org.kuali.rice.core.api.CoreConstants;
 32  
 import org.kuali.rice.core.api.mo.ModelBuilder;
 33  
 
 34  
 /**
 35  
  * This is a description of what this class does - ewestfal don't forget to fill this in. 
 36  
  * 
 37  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 38  
  *
 39  
  */
 40  
 @XmlRootElement(name = AgendaTreeSubAgendaEntry.Constants.ROOT_ELEMENT_NAME)
 41  
 @XmlAccessorType(XmlAccessType.NONE)
 42  
 @XmlType(name = AgendaTreeSubAgendaEntry.Constants.TYPE_NAME, propOrder = {
 43  
                 AgendaTreeSubAgendaEntry.Elements.AGENDA_ITEM_ID,
 44  
                 AgendaTreeSubAgendaEntry.Elements.SUB_AGENDA_ID,
 45  
                 CoreConstants.CommonElements.FUTURE_ELEMENTS
 46  
 })
 47  1
 public final class AgendaTreeSubAgendaEntry implements AgendaTreeEntryDefinition {
 48  
 
 49  
         private static final long serialVersionUID = 8594116503548506936L;
 50  
 
 51  
         @XmlElement(name = Elements.AGENDA_ITEM_ID, required = true)
 52  
         private final String agendaItemId;
 53  
         
 54  
         @XmlElement(name = Elements.SUB_AGENDA_ID, required = true)
 55  
         private final String subAgendaId;
 56  
                 
 57  4
         @SuppressWarnings("unused")
 58  
     @XmlAnyElement
 59  
     private final Collection<org.w3c.dom.Element> _futureElements = null;
 60  
         
 61  
         /**
 62  
          * Used only by JAXB.
 63  
          */
 64  3
         private AgendaTreeSubAgendaEntry() {
 65  3
                 this.agendaItemId = null;
 66  3
                 this.subAgendaId = null;
 67  3
         }
 68  
         
 69  1
         private AgendaTreeSubAgendaEntry(Builder builder) {
 70  1
                 this.agendaItemId = builder.getAgendaItemId();
 71  1
                 this.subAgendaId = builder.getSubAgendaId();
 72  1
         }
 73  
         
 74  
         @Override
 75  
         public String getAgendaItemId() {
 76  0
                 return agendaItemId;
 77  
         }
 78  
         
 79  
         public String getSubAgendaId() {
 80  0
                 return this.subAgendaId;
 81  
         }
 82  
 
 83  1
         public static class Builder implements ModelBuilder, Serializable {
 84  
         
 85  
                 private static final long serialVersionUID = 3548736700798501429L;
 86  
                 
 87  
                 private String agendaItemId;
 88  
                 private String subAgendaId;
 89  
 
 90  
                 /**
 91  
                  * Private constructor for creating a builder with all of it's required attributes.
 92  
                  */
 93  1
         private Builder(String agendaItemId, String subAgendaId) {
 94  1
                 setAgendaItemId(agendaItemId);
 95  1
                 setSubAgendaId(subAgendaId);
 96  1
         }
 97  
         
 98  
         public static Builder create(String agendaItemId, String subAgendaId){
 99  1
                 return new Builder(agendaItemId, subAgendaId);
 100  
         }
 101  
         
 102  
         public String getAgendaItemId() {
 103  1
                         return this.agendaItemId;
 104  
                 }
 105  
 
 106  
                 public String getSubAgendaId() {
 107  1
                         return this.subAgendaId;
 108  
                 }
 109  
                 
 110  
                 public void setAgendaItemId(String agendaItemId) {
 111  1
                         if (agendaItemId == null) {
 112  0
                                 throw new IllegalArgumentException("agendaItemId was null");
 113  
                         }
 114  1
                         this.agendaItemId = agendaItemId;
 115  1
                 }
 116  
 
 117  
                 public void setSubAgendaId(String subAgendaId) {
 118  1
                         if (subAgendaId == null) {
 119  0
                                 throw new IllegalArgumentException("subAgendaId was null");
 120  
                         }
 121  1
                         this.subAgendaId = subAgendaId;
 122  1
                 }
 123  
 
 124  
                 @Override
 125  
         public AgendaTreeSubAgendaEntry build() {
 126  1
             return new AgendaTreeSubAgendaEntry(this);
 127  
         }
 128  
                 
 129  
     }
 130  
     
 131  
         @Override
 132  
         public int hashCode() {
 133  0
                 return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE);
 134  
         }
 135  
 
 136  
         @Override
 137  
         public boolean equals(Object obj) {
 138  1
                 return EqualsBuilder.reflectionEquals(obj, this, Constants.HASH_CODE_EQUALS_EXCLUDE);
 139  
         }
 140  
 
 141  
         @Override
 142  
         public String toString() {
 143  0
                 return ToStringBuilder.reflectionToString(this);
 144  
         }
 145  
         
 146  
         /**
 147  
          * Defines some internal constants used on this class.
 148  
          */
 149  0
         static class Constants {
 150  
                 final static String ROOT_ELEMENT_NAME = "agendaTreeSubAgendaEntry";
 151  
                 final static String TYPE_NAME = "AgendaTreeSubAgendaEntryType";
 152  1
                 final static String[] HASH_CODE_EQUALS_EXCLUDE = { "_elements" };
 153  
         }
 154  
         
 155  
         /**
 156  
          * A private class which exposes constants which define the XML element names to use
 157  
          * when this object is marshalled to XML.
 158  
          */
 159  0
         static class Elements {
 160  
                 final static String AGENDA_ITEM_ID = "agendaItemId";
 161  
                 final static String SUB_AGENDA_ID = "subAgendaId";
 162  
         }
 163  
 
 164  
 }