本文整理汇总了Java中org.kuali.rice.core.api.criteria.OrPredicate类的典型用法代码示例。如果您正苦于以下问题:Java OrPredicate类的具体用法?Java OrPredicate怎么用?Java OrPredicate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrPredicate类属于org.kuali.rice.core.api.criteria包,在下文中一共展示了OrPredicate类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyCompositePredicate
import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
private Predicate applyCompositePredicate(final CompositePredicate input) {
Set<Predicate> appliedPredicates = new HashSet<Predicate>();
for (Predicate predicate : input.getPredicates()) {
appliedPredicates.add(applyPredicate(predicate));
}
Predicate[] appliedPredicatesArray = Iterables.toArray(appliedPredicates, Predicate.class);
if (input instanceof AndPredicate) {
return and(appliedPredicatesArray);
} else if (input instanceof OrPredicate) {
return or(appliedPredicatesArray);
}
return input;
}
示例2: addCompositePredicate
import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
/**
* Adds a composite predicate to a criteria.
*
* @param p the composite predicate to add.
* @param parent the parent criteria to add to.
*/
protected void addCompositePredicate(final CompositePredicate p, final C parent) {
for (Predicate ip : p.getPredicates()) {
final C inner = createInnerCriteria(parent);
addPredicate(ip, inner);
if (p instanceof AndPredicate) {
addAnd(parent, inner);
} else if (p instanceof OrPredicate) {
addOr(parent, inner);
} else {
throw new UnsupportedPredicateException(p);
}
}
}
示例3: addCompositePredicate
import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
/** adds a composite predicate to a Criteria. */
private void addCompositePredicate(final CompositePredicate p, final Criteria parent, LookupCustomizer.Transform<Predicate, Predicate> transform) {
for (Predicate ip : p.getPredicates()) {
final Criteria inner = new Criteria();
addPredicate(ip, inner, transform);
if (p instanceof AndPredicate) {
parent.addAndCriteria(inner);
} else if (p instanceof OrPredicate) {
parent.addOrCriteria(inner);
} else {
throw new UnsupportedPredicateException(p);
}
}
}
示例4: matches
import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
/**
* protected for testing
*/
protected boolean matches(T infoObject, Predicate predicate) {
// no predicate matches everyting
if (predicate == null) {
return true;
}
if (predicate instanceof OrPredicate) {
return matchesOr(infoObject, (OrPredicate) predicate);
}
if (predicate instanceof AndPredicate) {
return matchesAnd(infoObject, (AndPredicate) predicate);
}
if (predicate instanceof EqualPredicate) {
return matchesEqual(infoObject, (EqualPredicate) predicate);
}
if (predicate instanceof LessThanPredicate) {
return matchesLessThan(infoObject, (LessThanPredicate) predicate);
}
if (predicate instanceof LessThanOrEqualPredicate) {
return matchesLessThanOrEqual(infoObject, (LessThanOrEqualPredicate) predicate);
}
if (predicate instanceof GreaterThanPredicate) {
return matchesGreaterThan(infoObject, (GreaterThanPredicate) predicate);
}
if (predicate instanceof GreaterThanOrEqualPredicate) {
return matchesGreaterThanOrEqual(infoObject, (GreaterThanOrEqualPredicate) predicate);
}
if (predicate instanceof LikePredicate) {
return matchesLike(infoObject, (LikePredicate) predicate);
}
throw new UnsupportedOperationException("predicate type not supported yet in in-memory mathcer" + predicate.getClass().getName());
}
示例5: matchesOr
import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
private boolean matchesOr(T infoObject, OrPredicate predicate) {
for (Predicate subPred : predicate.getPredicates()) {
if (matches(infoObject, subPred)) {
return true;
}
}
return false;
}
示例6: addCompositePredicate
import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
/** adds a composite predicate to a Criteria. */
private void addCompositePredicate(final CompositePredicate p, final Criteria parent, LookupCustomizer.Transform<Predicate, Predicate> transform) {
for (Predicate ip : p.getPredicates()) {
final Criteria inner = new Criteria(parent.getEntityName());
addPredicate(ip, inner, transform);
if (p instanceof AndPredicate) {
parent.and(inner);
} else if (p instanceof OrPredicate) {
parent.or(inner);
} else {
throw new UnsupportedPredicateException(p);
}
}
}