Coverage Report - org.kuali.rice.kew.api.document.WorkflowAttributeValidationError
 
Classes in this File Line Coverage Branch Coverage Complexity
WorkflowAttributeValidationError
0%
0/19
0%
0/4
1.5
WorkflowAttributeValidationError$Constants
0%
0/2
N/A
1.5
WorkflowAttributeValidationError$Elements
0%
0/1
N/A
1.5
 
 1  
 /*
 2  
  * Copyright 2005-2009, 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;
 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.StringUtils;
 29  
 import org.apache.commons.lang.builder.EqualsBuilder;
 30  
 import org.apache.commons.lang.builder.HashCodeBuilder;
 31  
 import org.apache.commons.lang.builder.ToStringBuilder;
 32  
 import org.kuali.rice.core.api.CoreConstants;
 33  
 import org.w3c.dom.Element;
 34  
 
 35  
 /**
 36  
  * TODO...
 37  
  */
 38  
 @XmlRootElement(name = WorkflowAttributeValidationError.Constants.ROOT_ELEMENT_NAME)
 39  
 @XmlAccessorType(XmlAccessType.NONE)
 40  
 @XmlType(name = WorkflowAttributeValidationError.Constants.TYPE_NAME, propOrder = {
 41  
         WorkflowAttributeValidationError.Elements.KEY,
 42  
         WorkflowAttributeValidationError.Elements.MESSAGE,
 43  
         CoreConstants.CommonElements.FUTURE_ELEMENTS
 44  
 })
 45  
 public final class WorkflowAttributeValidationError implements Serializable {
 46  
 
 47  
     private static final long serialVersionUID = 3323649177455266977L;
 48  
 
 49  
     @XmlElement(name = Elements.KEY, required = true)
 50  
     private final String key;
 51  
     
 52  
     @XmlElement(name = Elements.MESSAGE, required = true)
 53  
     private final String message;
 54  
     
 55  0
     @SuppressWarnings("unused")
 56  
     @XmlAnyElement
 57  
     private final Collection<Element> _futureElements = null;
 58  
 
 59  
     /**
 60  
      * Private constructor used only by JAXB.
 61  
      */
 62  0
     public WorkflowAttributeValidationError() {
 63  0
             this.key = null;
 64  0
             this.message = null;
 65  0
     }
 66  
     
 67  0
     private WorkflowAttributeValidationError(String key, String message) {
 68  0
         if (StringUtils.isBlank(key)) {
 69  0
             throw new IllegalArgumentException("key was null or blank");
 70  
         }
 71  0
         if (StringUtils.isBlank(message)) {
 72  0
             throw new IllegalArgumentException("message was null or blank");
 73  
         }
 74  0
         this.key = key;
 75  0
         this.message = message;
 76  0
     }
 77  
     
 78  
     public static WorkflowAttributeValidationError create(String key, String message) {
 79  0
         return new WorkflowAttributeValidationError(key, message);
 80  
     }
 81  
     
 82  
     public String getKey() {
 83  0
         return key;
 84  
     }
 85  
 
 86  
     public String getMessage() {
 87  0
         return message;
 88  
     }
 89  
     
 90  
     @Override
 91  
     public int hashCode() {
 92  0
         return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE);
 93  
     }
 94  
 
 95  
     @Override
 96  
     public boolean equals(Object object) {
 97  0
         return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE);
 98  
     }
 99  
 
 100  
     @Override
 101  
     public String toString() {
 102  0
         return ToStringBuilder.reflectionToString(this);
 103  
     }
 104  
 
 105  
     /**
 106  
      * Defines some internal constants used on this class.
 107  
      */
 108  0
     static class Constants {
 109  
         final static String ROOT_ELEMENT_NAME = "workflowAttributeValidationError";
 110  
         final static String TYPE_NAME = "WorkflowAttributeValidationErrorType";
 111  0
         final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[]{CoreConstants.CommonElements.FUTURE_ELEMENTS};
 112  
     }
 113  
 
 114  
     /**
 115  
      * A private class which exposes constants which define the XML element names to use when this
 116  
      * object is marshalled to XML.
 117  
      */
 118  0
     static class Elements {
 119  
         final static String KEY = "key";
 120  
         final static String MESSAGE = "message";
 121  
     }
 122  
 
 123  
     
 124  
 }