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