com.github.mikesafonov.specification.builder.starter.predicates.EqualsPredicateBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-starter-specification-builder Show documentation
Show all versions of spring-boot-starter-specification-builder Show documentation
Spring Boot starter for building specifications in declarative way
package com.github.mikesafonov.specification.builder.starter.predicates;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Predicate;
/**
* Builder for {@code equals} predicate
*
* @author MikeSafonov
*/
public class EqualsPredicateBuilder extends SimplePredicateBuilder {
private final CriteriaBuilder cb;
private final Object fieldValue;
public EqualsPredicateBuilder(CriteriaBuilder cb, Object fieldValue, Expression expression) {
super(expression);
this.cb = cb;
this.fieldValue = fieldValue;
}
@Override
public Predicate build() {
return cb.equal(expression, fieldValue);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy