Coverage Report - org.kuali.rice.kew.api.action.RoutingReportActionToTake
 
Classes in this File Line Coverage Branch Coverage Complexity
RoutingReportActionToTake
0%
0/15
N/A
1.133
RoutingReportActionToTake$1
N/A
N/A
1.133
RoutingReportActionToTake$Builder
0%
0/20
0%
0/2
1.133
RoutingReportActionToTake$Constants
0%
0/1
N/A
1.133
RoutingReportActionToTake$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.action;
 17  
 
 18  
 import org.kuali.rice.core.api.CoreConstants;
 19  
 import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
 20  
 import org.kuali.rice.core.api.mo.ModelBuilder;
 21  
 import org.w3c.dom.Element;
 22  
 
 23  
 import javax.xml.bind.annotation.XmlAccessType;
 24  
 import javax.xml.bind.annotation.XmlAccessorType;
 25  
 import javax.xml.bind.annotation.XmlAnyElement;
 26  
 import javax.xml.bind.annotation.XmlElement;
 27  
 import javax.xml.bind.annotation.XmlRootElement;
 28  
 import javax.xml.bind.annotation.XmlType;
 29  
 import java.io.Serializable;
 30  
 import java.util.Collection;
 31  
 
 32  
 
 33  
 /**
 34  
  * A transport object representing an action a user might take
 35  
  *
 36  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 37  
  */
 38  
 @XmlRootElement(name = RoutingReportActionToTake.Constants.ROOT_ELEMENT_NAME)
 39  
 @XmlAccessorType(XmlAccessType.NONE)
 40  
 @XmlType(name = RoutingReportActionToTake.Constants.TYPE_NAME, propOrder = {
 41  
     RoutingReportActionToTake.Elements.ACTION_TO_PERFORM,
 42  
     RoutingReportActionToTake.Elements.PRINCIPAL_ID,
 43  
     RoutingReportActionToTake.Elements.NODE_NAME,
 44  
     CoreConstants.CommonElements.FUTURE_ELEMENTS
 45  
 })
 46  0
 public final class RoutingReportActionToTake
 47  
     extends AbstractDataTransferObject
 48  
     implements RoutingReportActionToTakeContract
 49  
 {
 50  
 
 51  
     @XmlElement(name = Elements.ACTION_TO_PERFORM, required = false)
 52  
     private final String actionToPerform;
 53  
     @XmlElement(name = Elements.PRINCIPAL_ID, required = false)
 54  
     private final String principalId;
 55  
     @XmlElement(name = Elements.NODE_NAME, required = false)
 56  
     private final String nodeName;
 57  0
     @SuppressWarnings("unused")
 58  
     @XmlAnyElement
 59  
     private final Collection<Element> _futureElements = null;
 60  
 
 61  
     /**
 62  
      * Private constructor used only by JAXB.
 63  
      * 
 64  
      */
 65  0
     private RoutingReportActionToTake() {
 66  0
         this.actionToPerform = null;
 67  0
         this.principalId = null;
 68  0
         this.nodeName = null;
 69  0
     }
 70  
 
 71  0
     private RoutingReportActionToTake(Builder builder) {
 72  0
         this.actionToPerform = builder.getActionToPerform();
 73  0
         this.principalId = builder.getPrincipalId();
 74  0
         this.nodeName = builder.getNodeName();
 75  0
     }
 76  
 
 77  
     @Override
 78  
     public String getActionToPerform() {
 79  0
         return this.actionToPerform;
 80  
     }
 81  
 
 82  
     @Override
 83  
     public String getPrincipalId() {
 84  0
         return this.principalId;
 85  
     }
 86  
 
 87  
     @Override
 88  
     public String getNodeName() {
 89  0
         return this.nodeName;
 90  
     }
 91  
 
 92  
 
 93  
     /**
 94  
      * A builder which can be used to construct {@link RoutingReportActionToTake} instances.  Enforces the constraints of the {@link RoutingReportActionToTakeContract}.
 95  
      * 
 96  
      */
 97  0
     public final static class Builder
 98  
         implements Serializable, ModelBuilder, RoutingReportActionToTakeContract
 99  
     {
 100  
 
 101  
         private String actionToPerform;
 102  
         private String principalId;
 103  
         private String nodeName;
 104  
 
 105  0
         private Builder(String actionToPerform, String principalId, String nodeName) {
 106  0
             this.setActionToPerform(actionToPerform);
 107  0
             this.setPrincipalId(principalId);
 108  0
             this.setNodeName(nodeName);
 109  0
         }
 110  
 
 111  
         public static Builder create(String actionToPerform, String principalId, String nodeName) {
 112  0
             return new Builder(actionToPerform, principalId, nodeName);
 113  
         }
 114  
 
 115  
         public static Builder create(RoutingReportActionToTakeContract contract) {
 116  0
             if (contract == null) {
 117  0
                 throw new IllegalArgumentException("contract was null");
 118  
             }
 119  0
             return create(contract.getActionToPerform(), contract.getPrincipalId(), contract.getNodeName());
 120  
         }
 121  
 
 122  
         public RoutingReportActionToTake build() {
 123  0
             return new RoutingReportActionToTake(this);
 124  
         }
 125  
 
 126  
         @Override
 127  
         public String getActionToPerform() {
 128  0
             return this.actionToPerform;
 129  
         }
 130  
 
 131  
         @Override
 132  
         public String getPrincipalId() {
 133  0
             return this.principalId;
 134  
         }
 135  
 
 136  
         @Override
 137  
         public String getNodeName() {
 138  0
             return this.nodeName;
 139  
         }
 140  
 
 141  
         public void setActionToPerform(String actionToPerform) {
 142  0
             this.actionToPerform = actionToPerform;
 143  0
         }
 144  
 
 145  
         public void setPrincipalId(String principalId) {
 146  0
             this.principalId = principalId;
 147  0
         }
 148  
 
 149  
         public void setNodeName(String nodeName) {
 150  0
             this.nodeName = nodeName;
 151  0
         }
 152  
 
 153  
     }
 154  
 
 155  
 
 156  
     /**
 157  
      * Defines some internal constants used on this class.
 158  
      * 
 159  
      */
 160  0
     static class Constants {
 161  
 
 162  
         final static String ROOT_ELEMENT_NAME = "routingReportActionToTake";
 163  
         final static String TYPE_NAME = "RoutingReportActionToTakeType";
 164  
 
 165  
     }
 166  
 
 167  
 
 168  
     /**
 169  
      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
 170  
      * 
 171  
      */
 172  0
     static class Elements {
 173  
 
 174  
         final static String ACTION_TO_PERFORM = "actionToPerform";
 175  
         final static String PRINCIPAL_ID = "principalId";
 176  
         final static String NODE_NAME = "nodeName";
 177  
 
 178  
     }
 179  
 
 180  
 }