Coverage report

  %line %branch
org.apache.jetspeed.profiler.rules.impl.RuleCriterionImpl
0% 
0% 

 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  * 
 9  
  *      http://www.apache.org/licenses/LICENSE-2.0
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.apache.jetspeed.profiler.rules.impl;
 18  
 
 19  
 import org.apache.jetspeed.profiler.rules.RuleCriterion;
 20  
 
 21  
 /**
 22  
  * RuleCriterionImpl
 23  
  *
 24  
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
 25  
  * @version $Id: RuleCriterionImpl.java 516448 2007-03-09 16:25:47Z ate $
 26  
  */
 27  
 public class RuleCriterionImpl implements RuleCriterion
 28  
 {
 29  
     private String id;
 30  
     private String ruleId;
 31  
     private String type;
 32  0
     private String name = null;
 33  
     private String value;
 34  0
     private int fallbackType = RuleCriterion.FALLBACK_CONTINUE;
 35  
     private int fallbackOrder;
 36  
     
 37  
     public RuleCriterionImpl()
 38  0
     {
 39  0
     }
 40  
 
 41  
     public RuleCriterionImpl(RuleCriterion master)
 42  0
     {
 43  0
         this.name = master.getName();
 44  0
         this.ruleId = master.getRuleId();
 45  0
         this.type = master.getType();
 46  0
         this.value = master.getValue();
 47  0
         this.fallbackOrder = master.getFallbackOrder();
 48  0
         this.fallbackType = master.getFallbackType();
 49  0
     }
 50  
     /**
 51  
      * two objects of type RuleCriterion should be considered equal if their name and type  are the same
 52  
      * 
 53  
      */
 54  
      public boolean equals(Object o)
 55  
     {
 56  0
     	if (this == o) return true;
 57  0
     	if ((o == null) || (!(o instanceof RuleCriterion)))
 58  0
     		return false;
 59  0
     	RuleCriterion r = (RuleCriterion)o;
 60  0
     	if (this.name != null)
 61  
     	{
 62  0
     		if (!(this.name.equals(r.getName())))
 63  0
     				return false;
 64  
     	}
 65  
     	else
 66  0
     		if (r.getName() != null)
 67  0
     			return false;
 68  0
     	if (this.type != null)
 69  
     	{
 70  0
     		if (!(this.type.equals(r.getName())))
 71  0
     				return false;
 72  
     	}
 73  
     	else
 74  0
     		if (r.getType() != null)
 75  0
     			return false;
 76  0
     	return true;    	
 77  
     	
 78  
     }
 79  
     /* (non-Javadoc)
 80  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#getType()
 81  
      */
 82  
     public String getType()
 83  
     {
 84  0
         return this.type;
 85  
     }
 86  
     
 87  
     /* (non-Javadoc)
 88  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#setType(java.lang.String)
 89  
      */
 90  
     public void setType(String type)
 91  
     {
 92  0
         this.type = type;
 93  0
     }
 94  
     
 95  
     /* (non-Javadoc)
 96  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#getName()
 97  
      */
 98  
     public String getName()
 99  
     {
 100  0
         return this.name;
 101  
     }
 102  
     
 103  
     /* (non-Javadoc)
 104  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#setName(java.lang.String)
 105  
      */
 106  
     public void setName(String name)
 107  
     {
 108  0
         this.name = name;
 109  0
     }
 110  
 
 111  
     /* (non-Javadoc)
 112  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#getRuleId()
 113  
      */
 114  
     public String getRuleId()
 115  
     {
 116  0
         return ruleId;
 117  
     }
 118  
 
 119  
     /* (non-Javadoc)
 120  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#setRuleId(java.lang.String)
 121  
      */
 122  
     public void setRuleId(String ruleId)
 123  
     {
 124  0
         this.ruleId = ruleId;
 125  0
     }
 126  
 
 127  
     /* (non-Javadoc)
 128  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#getFallbackOrder()
 129  
      */
 130  
     public int getFallbackOrder()
 131  
     {
 132  0
         return fallbackOrder;
 133  
     }
 134  
 
 135  
     /* (non-Javadoc)
 136  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#getValue()
 137  
      */
 138  
     public String getValue()
 139  
     {
 140  0
         return value;
 141  
     }
 142  
 
 143  
     /* (non-Javadoc)
 144  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#setFallbackOrder(int)
 145  
      */
 146  
     public void setFallbackOrder(int i)
 147  
     {
 148  0
         fallbackOrder = i;
 149  0
     }
 150  
 
 151  
     /* (non-Javadoc)
 152  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#setValue(java.lang.String)
 153  
      */
 154  
     public void setValue(String value)
 155  
     {
 156  0
         this.value = value;
 157  0
     }
 158  
 
 159  
     /* (non-Javadoc)
 160  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#getFallbackType()
 161  
      */
 162  
     public int getFallbackType()
 163  
     {
 164  0
         return fallbackType;
 165  
     }
 166  
 
 167  
     /* (non-Javadoc)
 168  
      * @see org.apache.jetspeed.profiler.rules.RuleCriterion#setFallbackType(int)
 169  
      */
 170  
     public void setFallbackType(int i)
 171  
     {
 172  0
         fallbackType = i;
 173  0
     }
 174  
 
 175  
     
 176  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.