Coverage Report - org.kuali.rice.kew.api.document.RouteNodeInstanceState
 
Classes in this File Line Coverage Branch Coverage Complexity
RouteNodeInstanceState
0%
0/18
N/A
1.111
RouteNodeInstanceState$1
N/A
N/A
1.111
RouteNodeInstanceState$Builder
0%
0/21
0%
0/2
1.111
RouteNodeInstanceState$Constants
0%
0/2
N/A
1.111
RouteNodeInstanceState$Elements
0%
0/1
N/A
1.111
 
 1  
 /*
 2  
  * Copyright 2011 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/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.kew.api.document;
 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  
 import org.kuali.rice.core.api.mo.ModelObjectComplete;
 34  
 import org.w3c.dom.Element;
 35  
 
 36  
 @XmlRootElement(name = RouteNodeInstanceState.Constants.ROOT_ELEMENT_NAME)
 37  
 @XmlAccessorType(XmlAccessType.NONE)
 38  
 @XmlType(name = RouteNodeInstanceState.Constants.TYPE_NAME, propOrder = {
 39  
     RouteNodeInstanceState.Elements.VALUE,
 40  
     RouteNodeInstanceState.Elements.KEY,
 41  
     RouteNodeInstanceState.Elements.ID,
 42  
     CoreConstants.CommonElements.FUTURE_ELEMENTS
 43  
 })
 44  0
 public final class RouteNodeInstanceState
 45  
     implements ModelObjectComplete, RouteNodeInstanceStateContract
 46  
 {
 47  
 
 48  
         @XmlElement(name = Elements.ID, required = false)
 49  
     private final String id;
 50  
     @XmlElement(name = Elements.VALUE, required = false)
 51  
     private final String value;
 52  
     @XmlElement(name = Elements.KEY, required = false)
 53  
     private final String key;
 54  0
     @SuppressWarnings("unused")
 55  
     @XmlAnyElement
 56  
     private final Collection<Element> _futureElements = null;
 57  
 
 58  
     /**
 59  
      * Private constructor used only by JAXB.
 60  
      * 
 61  
      */
 62  0
     private RouteNodeInstanceState() {
 63  0
             this.id = null;
 64  0
         this.value = null;
 65  0
         this.key = null;
 66  0
     }
 67  
 
 68  0
     private RouteNodeInstanceState(Builder builder) {
 69  0
             this.id = builder.getId();
 70  0
         this.value = builder.getValue();
 71  0
         this.key = builder.getKey();
 72  0
     }
 73  
 
 74  
     @Override
 75  
     public String getId() {
 76  0
         return this.id;
 77  
     }
 78  
     
 79  
     @Override
 80  
     public String getValue() {
 81  0
         return this.value;
 82  
     }
 83  
 
 84  
     @Override
 85  
     public String getKey() {
 86  0
         return this.key;
 87  
     }
 88  
 
 89  
     @Override
 90  
     public int hashCode() {
 91  0
         return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE);
 92  
     }
 93  
 
 94  
     @Override
 95  
     public boolean equals(Object object) {
 96  0
         return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE);
 97  
     }
 98  
 
 99  
     @Override
 100  
     public String toString() {
 101  0
         return ToStringBuilder.reflectionToString(this);
 102  
     }
 103  
 
 104  
     /**
 105  
      * A builder which can be used to construct {@link RouteNodeInstanceState} instances.  Enforces the constraints of the {@link RouteNodeInstanceStateContract}.
 106  
      */
 107  0
     public final static class Builder
 108  
         implements Serializable, ModelBuilder, RouteNodeInstanceStateContract
 109  
     {
 110  
 
 111  
         private String id;
 112  
         private String value;
 113  
         private String key;
 114  
 
 115  0
         private Builder() {
 116  
             // TODO modify this constructor as needed to pass any required values and invoke the appropriate 'setter' methods
 117  0
         }
 118  
 
 119  
         public static Builder create() {
 120  
             // TODO modify as needed to pass any required values and add them to the signature of the 'create' method
 121  0
             return new Builder();
 122  
         }
 123  
 
 124  
         public static Builder create(RouteNodeInstanceStateContract contract) {
 125  0
             if (contract == null) {
 126  0
                 throw new IllegalArgumentException("contract was null");
 127  
             }
 128  
             // TODO if create() is modified to accept required parameters, this will need to be modified
 129  0
             Builder builder = create();
 130  0
             builder.setId(contract.getId());
 131  0
             builder.setValue(contract.getValue());
 132  0
             builder.setKey(contract.getKey());
 133  0
             return builder;
 134  
         }
 135  
 
 136  
         public RouteNodeInstanceState build() {
 137  0
             return new RouteNodeInstanceState(this);
 138  
         }
 139  
 
 140  
         @Override
 141  
         public String getValue() {
 142  0
             return this.value;
 143  
         }
 144  
 
 145  
         @Override
 146  
         public String getKey() {
 147  0
             return this.key;
 148  
         }
 149  
 
 150  
         @Override
 151  
         public String getId() {
 152  0
             return this.id;
 153  
         }
 154  
 
 155  
         public void setValue(String value) {
 156  
             // TODO add validation of input value if required and throw IllegalArgumentException if needed
 157  0
             this.value = value;
 158  0
         }
 159  
 
 160  
         public void setKey(String key) {
 161  
             // TODO add validation of input value if required and throw IllegalArgumentException if needed
 162  0
             this.key = key;
 163  0
         }
 164  
 
 165  
         public void setId(String id) {
 166  
             // TODO add validation of input value if required and throw IllegalArgumentException if needed
 167  0
             this.id = id;
 168  0
         }
 169  
 
 170  
     }
 171  
 
 172  
 
 173  
     /**
 174  
      * Defines some internal constants used on this class.
 175  
      * 
 176  
      */
 177  0
     static class Constants {
 178  
 
 179  
         final static String ROOT_ELEMENT_NAME = "routeNodeInstanceState";
 180  
         final static String TYPE_NAME = "RouteNodeInstanceStateType";
 181  0
         final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] {CoreConstants.CommonElements.FUTURE_ELEMENTS };
 182  
 
 183  
     }
 184  
 
 185  
 
 186  
     /**
 187  
      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
 188  
      * 
 189  
      */
 190  0
     static class Elements {
 191  
 
 192  
         final static String VALUE = "value";
 193  
         final static String KEY = "key";
 194  
         final static String ID = "id";
 195  
 
 196  
     }
 197  
 
 198  
 }
 199