1 10 11 package org.mule.routing.filters.logic; 12 13 import org.mule.umo.UMOFilter; 14 import org.mule.umo.UMOMessage; 15 16 20 21 public class AndFilter implements UMOFilter 22 { 23 private UMOFilter leftFilter; 24 private UMOFilter rightFilter; 25 26 public AndFilter() 27 { 28 super(); 29 } 30 31 public AndFilter(UMOFilter left, UMOFilter right) 32 { 33 this.leftFilter = left; 34 this.rightFilter = right; 35 } 36 37 public void setLeftFilter(UMOFilter leftFilter) 38 { 39 this.leftFilter = leftFilter; 40 } 41 42 public void setRightFilter(UMOFilter rightFilter) 43 { 44 this.rightFilter = rightFilter; 45 } 46 47 public UMOFilter getLeftFilter() 48 { 49 return leftFilter; 50 } 51 52 public UMOFilter getRightFilter() 53 { 54 return rightFilter; 55 } 56 57 public boolean accept(UMOMessage message) 58 { 59 if (leftFilter != null && rightFilter != null) 60 { 61 return leftFilter.accept(message) && rightFilter.accept(message); 62 } 63 else 64 { 65 return false; 66 } 67 } 68 69 } 70 | Popular Tags |