Example usage for org.apache.commons.collections4 PredicateUtils falsePredicate

List of usage examples for org.apache.commons.collections4 PredicateUtils falsePredicate

Introduction

In this page you can find the example usage for org.apache.commons.collections4 PredicateUtils falsePredicate.

Prototype

public static <T> Predicate<T> falsePredicate() 

Source Link

Document

Gets a Predicate that always returns false.

Usage

From source file:com.vrem.util.EnumUtilsTest.java

@Test
public void testFindUsingPredicateWhenNothingFound() throws Exception {
    // setup//from   w  w  w.j  ava2  s .c o  m
    TestObject expected = TestObject.VALUE2;
    Predicate<TestObject> predicate = PredicateUtils.falsePredicate();
    // execute
    TestObject actual = EnumUtils.find(TestObject.class, predicate, expected);
    // validate
    assertEquals(expected, actual);
}

From source file:cz.lidinsky.editor.TableCellEditor.java

/**
 *  It fills combo box for a chenger property. It fills the keys
 *  of the parent component.//from  w w  w.ja va2s .  co  m
 *
 *  @param object
 *             a parent object of the changer
 *
 *  @param _class
 *             a data type
 */
private void fillComboBox(Object object, Class _class) {
    // initialize object map
    ObjectMapDecorator<Object> map = new ObjectMapDecorator<Object>(Object.class)
            .setGetterFilter(PredicateUtils.falsePredicate())
            .setSetterFilter(PredicateUtils.allPredicate(ObjectMapUtils.hasAnnotationPredicate(Setter.class),
                    ObjectMapUtils.getSetterDataTypeCheckPredicate(_class)))
            .setSetterKeyTransformer(ObjectMapUtils.getSetterKeyTransformer());
    map.setDecorated(object);
    // fill in the keys
    comboBox.removeAllItems();
    for (String key : map.keySet()) {
        comboBox.addItem(key);
    }
}