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