Example usage for org.apache.commons.beanutils BeanPredicate evaluate

List of usage examples for org.apache.commons.beanutils BeanPredicate evaluate

Introduction

In this page you can find the example usage for org.apache.commons.beanutils BeanPredicate evaluate.

Prototype

public boolean evaluate(Object object) 

Source Link

Document

Evaluates the given object by applying the #getPredicate() to a property value named by #getPropertyName() .

Usage

From source file:BeanUtilsCollectionsV2.java

 public static void main(String args[]) {
   BeanPredicate predicate =
     new BeanPredicate("title", PredicateUtils.uniquePredicate());

   Movie movie = new Movie();
   movie.setTitle("The Italian Job");

   Movie movie1 = new Movie();
   movie1.setTitle("The Italian Job");

   System.err.println(predicate.evaluate(movie)); // evaluates true
   System.err.println(predicate.evaluate(movie1)); // evaluates false

}