Coverage Report - org.mule.routing.filters.logic.AndFilter
 
Classes in this File Line Coverage Branch Coverage Complexity
AndFilter
0%
0/15
0%
0/2
1.286
 
 1  
 /*
 2  
  * $Id: AndFilter.java 7976 2007-08-21 14:26:13Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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 org.mule.umo.UMOFilter;
 14  
 import org.mule.umo.UMOMessage;
 15  
 
 16  
 /**
 17  
  * <code>AndFilter</code> accepts only if the leftFilter and rightFilter filter
 18  
  * accept.
 19  
  */
 20  
 
 21  
 public class AndFilter implements UMOFilter
 22  
 {
 23  
     private UMOFilter leftFilter;
 24  
     private UMOFilter rightFilter;
 25  
 
 26  
     public AndFilter()
 27  
     {
 28  0
         super();
 29  0
     }
 30  
 
 31  
     public AndFilter(UMOFilter left, UMOFilter right)
 32  0
     {
 33  0
         this.leftFilter = left;
 34  0
         this.rightFilter = right;
 35  0
     }
 36  
 
 37  
     public void setLeftFilter(UMOFilter leftFilter)
 38  
     {
 39  0
         this.leftFilter = leftFilter;
 40  0
     }
 41  
 
 42  
     public void setRightFilter(UMOFilter rightFilter)
 43  
     {
 44  0
         this.rightFilter = rightFilter;
 45  0
     }
 46  
 
 47  
     public UMOFilter getLeftFilter()
 48  
     {
 49  0
         return leftFilter;
 50  
     }
 51  
 
 52  
     public UMOFilter getRightFilter()
 53  
     {
 54  0
         return rightFilter;
 55  
     }
 56  
 
 57  
     public boolean accept(UMOMessage message)
 58  
     {
 59  0
         if (leftFilter != null && rightFilter != null)
 60  
         {
 61  0
             return leftFilter.accept(message) && rightFilter.accept(message);
 62  
         }
 63  
         else
 64  
         {
 65  0
             return false;
 66  
         }
 67  
     }
 68  
 
 69  
 }