org.beangle.model.predicates.ValidEntityKeyPredicate.java Source code

Java tutorial

Introduction

Here is the source code for org.beangle.model.predicates.ValidEntityKeyPredicate.java

Source

/* Copyright c 2005-2012.
 * Licensed under GNU  LESSER General Public License, Version 3.
 * http://www.gnu.org/licenses
 */
package org.beangle.model.predicates;

import org.apache.commons.collections.Predicate;
import org.beangle.commons.collection.predicates.NotEmptyStringPredicate;
import org.beangle.commons.collection.predicates.NotZeroNumberPredicate;

/**
 * ?
 * 
 * @author chaostone
 */
public class ValidEntityKeyPredicate implements Predicate {

    /**
     * @see org.apache.commons.collections.Predicate#evaluate(java.lang.Object)
     */
    public boolean evaluate(Object value) {
        return NotEmptyStringPredicate.INSTANCE.evaluate(value) || NotZeroNumberPredicate.INSTANCE.evaluate(value);
    }

    public static final ValidEntityKeyPredicate INSTANCE = new ValidEntityKeyPredicate();

    public static ValidEntityKeyPredicate getInstance() {
        return INSTANCE;
    }

}