1 16 package org.apache.commons.collections.functors; 17 18 import java.io.Serializable ; 19 20 import org.apache.commons.collections.Predicate; 21 22 31 public final class EqualPredicate implements Predicate, Serializable { 32 33 34 static final long serialVersionUID = 5633766978029907089L; 35 36 37 private final Object iValue; 38 39 46 public static Predicate getInstance(Object object) { 47 if (object == null) { 48 return NullPredicate.INSTANCE; 49 } 50 return new EqualPredicate(object); 51 } 52 53 59 public EqualPredicate(Object object) { 60 super(); 61 iValue = object; 62 } 63 64 70 public boolean evaluate(Object object) { 71 return (iValue.equals(object)); 72 } 73 74 80 public Object getValue() { 81 return iValue; 82 } 83 84 } 85 | Popular Tags |