Coverage Report - org.mule.routing.filters.logic.AndFilter
 
Classes in this File Line Coverage Branch Coverage Complexity
AndFilter
0%
0/12
0%
0/6
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 org.mule.api.MuleMessage;
 10  
 import org.mule.api.routing.filter.Filter;
 11  
 
 12  
 import java.util.List;
 13  
 
 14  
 /**
 15  
  * <code>AndFilter</code> accepts only if all the filters
 16  
  * accept.
 17  
  */
 18  
 public class AndFilter extends AbstractFilterCollection
 19  
 {
 20  
 
 21  
     public AndFilter()
 22  
     {
 23  0
         super();
 24  0
     }
 25  
 
 26  
     public AndFilter(Filter... filters)
 27  
     {
 28  0
         super(filters);
 29  0
     }
 30  
 
 31  
     public AndFilter(List<Filter> filters)
 32  
     {
 33  0
         super(filters);
 34  0
     }
 35  
 
 36  
     public boolean accept(MuleMessage message)
 37  
     {
 38  0
         if (getFilters().size() == 0)
 39  
         {
 40  0
             return false;
 41  
         }
 42  0
         for (Filter filter : getFilters())
 43  
         {
 44  0
             if (!filter.accept(message))
 45  
             {
 46  0
                 return false;
 47  
             }
 48  
         }
 49  
 
 50  0
         return true;
 51  
     }
 52  
 }