Coverage Report - org.kuali.rice.kew.api.action.MovePoint
 
Classes in this File Line Coverage Branch Coverage Complexity
MovePoint
0%
0/17
0%
0/2
1.25
MovePoint$Constants
0%
0/2
N/A
1.25
MovePoint$Elements
0%
0/1
N/A
1.25
 
 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.action;
 17  
 
 18  
 import java.util.Collection;
 19  
 
 20  
 import javax.xml.bind.annotation.XmlAccessType;
 21  
 import javax.xml.bind.annotation.XmlAccessorType;
 22  
 import javax.xml.bind.annotation.XmlAnyElement;
 23  
 import javax.xml.bind.annotation.XmlElement;
 24  
 import javax.xml.bind.annotation.XmlRootElement;
 25  
 import javax.xml.bind.annotation.XmlType;
 26  
 
 27  
 import org.apache.commons.lang.StringUtils;
 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.w3c.dom.Element;
 33  
 
 34  
 @XmlRootElement(name = MovePoint.Constants.ROOT_ELEMENT_NAME)
 35  
 @XmlAccessorType(XmlAccessType.NONE)
 36  
 @XmlType(name = MovePoint.Constants.TYPE_NAME, propOrder = {
 37  
                 MovePoint.Elements.START_NODE_NAME,
 38  
                 MovePoint.Elements.STEPS_TO_MOVE,
 39  
                 CoreConstants.CommonElements.FUTURE_ELEMENTS
 40  
 })
 41  
 public final class MovePoint {
 42  
     
 43  
         @XmlElement(name = Elements.START_NODE_NAME, required = true)
 44  
     private final String startNodeName;
 45  
         
 46  
         @XmlElement(name = Elements.STEPS_TO_MOVE, required = true)
 47  
     private final int stepsToMove;
 48  
     
 49  0
     @SuppressWarnings("unused")
 50  
     @XmlAnyElement
 51  
     private final Collection<Element> _futureElements = null;
 52  
 
 53  0
     private MovePoint() {
 54  0
             this.startNodeName = null;
 55  0
             this.stepsToMove = 0;
 56  0
     }
 57  
     
 58  0
     private MovePoint(String startNodeName, int stepsToMove) {
 59  0
             if (StringUtils.isBlank(startNodeName)) {
 60  0
                     throw new IllegalArgumentException("startNodeName was null or blank");
 61  
             }
 62  0
         this.startNodeName = startNodeName;
 63  0
         this.stepsToMove = stepsToMove;
 64  0
     }
 65  
     
 66  
     public static MovePoint create(String startNodeName, int stepsToMove) {
 67  0
             return new MovePoint(startNodeName, stepsToMove);
 68  
     }
 69  
     
 70  
     public String getStartNodeName() {
 71  0
         return startNodeName;
 72  
     }
 73  
 
 74  
     public int getStepsToMove() {
 75  0
         return stepsToMove;
 76  
     }
 77  
     
 78  
         @Override
 79  
     public int hashCode() {
 80  0
         return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE);
 81  
     }
 82  
 
 83  
     @Override
 84  
     public boolean equals(Object object) {
 85  0
         return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE);
 86  
     }
 87  
 
 88  
     @Override
 89  
     public String toString() {
 90  0
         return ToStringBuilder.reflectionToString(this);
 91  
     }
 92  
     
 93  
     /**
 94  
      * Defines some internal constants used on this class.
 95  
      */
 96  0
     static class Constants {
 97  
         final static String ROOT_ELEMENT_NAME = "movePoint";
 98  
         final static String TYPE_NAME = "MovePointType";
 99  0
         final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] { CoreConstants.CommonElements.FUTURE_ELEMENTS };
 100  
     }
 101  
     
 102  
     /**
 103  
      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
 104  
      */
 105  0
     static class Elements {
 106  
         final static String START_NODE_NAME = "startNodeName";
 107  
         final static String STEPS_TO_MOVE = "stepsToMove";
 108  
     }
 109  
 
 110  
 }