Coverage Report - org.mule.routing.filters.logic.NotFilter
 
Classes in this File Line Coverage Branch Coverage Complexity
NotFilter
0%
0/14
0%
0/10
0
 
 1  
 /*
 2  
  * $Id: NotFilter.java 19191 2010-08-25 21:05:23Z tcarlson $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.routing.filters.logic;
 12  
 
 13  
 import static org.mule.util.ClassUtils.equal;
 14  
 import static org.mule.util.ClassUtils.hash;
 15  
 
 16  
 import org.mule.api.MuleMessage;
 17  
 import org.mule.api.routing.filter.Filter;
 18  
 
 19  
 /**
 20  
  * <code>NotFilter</code> accepts if the filter does not accept.
 21  
  */
 22  
 
 23  
 public class NotFilter implements Filter
 24  
 {
 25  
     private Filter filter;
 26  
 
 27  
     public NotFilter()
 28  
     {
 29  0
         super();
 30  0
     }
 31  
 
 32  
     public NotFilter(Filter filter)
 33  0
     {
 34  0
         this.filter = filter;
 35  0
     }
 36  
 
 37  
     public Filter getFilter()
 38  
     {
 39  0
         return filter;
 40  
     }
 41  
 
 42  
     public void setFilter(Filter filter)
 43  
     {
 44  0
         this.filter = filter;
 45  0
     }
 46  
 
 47  
     public boolean accept(MuleMessage message)
 48  
     {
 49  0
         return (filter != null ? !filter.accept(message) : false);
 50  
     }
 51  
 
 52  
     public boolean equals(Object obj)
 53  
     {
 54  0
         if (this == obj) return true;
 55  0
         if (obj == null || getClass() != obj.getClass()) return false;
 56  
 
 57  0
         final NotFilter other = (NotFilter) obj;
 58  0
         return equal(filter, other.filter);
 59  
     }
 60  
 
 61  
     public int hashCode()
 62  
     {
 63  0
         return hash(new Object[]{this.getClass(), filter});
 64  
     }
 65  
 }