Coverage Report - org.kuali.rice.kew.api.action.AdHocToPrincipal
 
Classes in this File Line Coverage Branch Coverage Complexity
AdHocToPrincipal
0%
0/9
N/A
1.25
AdHocToPrincipal$1
N/A
N/A
1.25
AdHocToPrincipal$Builder
0%
0/11
0%
0/2
1.25
AdHocToPrincipal$Constants
0%
0/1
N/A
1.25
AdHocToPrincipal$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 javax.xml.bind.annotation.XmlAccessType;
 19  
 import javax.xml.bind.annotation.XmlAccessorType;
 20  
 import javax.xml.bind.annotation.XmlElement;
 21  
 import javax.xml.bind.annotation.XmlRootElement;
 22  
 import javax.xml.bind.annotation.XmlType;
 23  
 
 24  
 import org.apache.commons.lang.StringUtils;
 25  
 
 26  0
 @XmlRootElement(name = AdHocToPrincipal.Constants.ROOT_ELEMENT_NAME)
 27  
 @XmlAccessorType(XmlAccessType.NONE)
 28  
 @XmlType(name = AdHocToPrincipal.Constants.TYPE_NAME, propOrder = {
 29  
                 AdHocToPrincipal.Elements.TARGET_PRINCIPAL_ID
 30  
 })
 31  0
 public final class AdHocToPrincipal extends AdHocCommand {
 32  
 
 33  
         private static final long serialVersionUID = -4512561589558793736L;
 34  
 
 35  
         @XmlElement(name = Elements.TARGET_PRINCIPAL_ID, required = true)
 36  
         private final String targetPrincipalId;
 37  
 
 38  0
         private AdHocToPrincipal() {
 39  0
                 this.targetPrincipalId = null;
 40  0
         }
 41  
         
 42  
         private AdHocToPrincipal(Builder builder) {
 43  0
                 super(builder);
 44  0
                 this.targetPrincipalId = builder.getTargetPrincipalId();
 45  0
         }
 46  
 
 47  
         public String getTargetPrincipalId() {
 48  0
                 return targetPrincipalId;
 49  
         }
 50  
         
 51  0
         public static final class Builder extends AdHocCommand.Builder<AdHocToPrincipal> {
 52  
                 
 53  
                 private static final long serialVersionUID = 5288681963619747957L;
 54  
 
 55  
                 private String targetPrincipalId;
 56  
                 
 57  
                 private Builder(ActionRequestType actionRequested, String nodeName, String targetPrincipalId) {
 58  0
                         super(actionRequested, nodeName);
 59  0
                         setTargetPrincipalId(targetPrincipalId);
 60  0
                 }
 61  
                 
 62  
                 public static Builder create(ActionRequestType actionRequested, String nodeName, String targetPrincipalId) {
 63  0
                         return new Builder(actionRequested, nodeName, targetPrincipalId);
 64  
                 }
 65  
                 
 66  
                 public String getTargetPrincipalId() {
 67  0
                         return targetPrincipalId;
 68  
                 }
 69  
                 
 70  
                 public void setTargetPrincipalId(String targetPrincipalId) {
 71  0
                         if (StringUtils.isBlank(targetPrincipalId)) {
 72  0
                                 throw new IllegalArgumentException("targetPrincipalId was null or blank");
 73  
                         }
 74  0
                         this.targetPrincipalId = targetPrincipalId;
 75  0
                 }
 76  
                 
 77  
                 @Override
 78  
                 public AdHocToPrincipal build() {
 79  0
                         return new AdHocToPrincipal(this);
 80  
                 }
 81  
 
 82  
         }
 83  
         
 84  
         /**
 85  
      * Defines some internal constants used on this class.
 86  
      */
 87  0
     static class Constants {
 88  
         final static String ROOT_ELEMENT_NAME = "adHocToPrincipal";
 89  
         final static String TYPE_NAME = "AdHocToPrincipalType";
 90  
     }
 91  
     
 92  
     /**
 93  
      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
 94  
      */
 95  0
     static class Elements {
 96  
         final static String TARGET_PRINCIPAL_ID = "targetPrincipalId";
 97  
     }
 98  
 
 99  
         
 100  
 }