public BooleanExpression between(@Nullable T from, @Nullable T to) {
        if (from == null) {
            if (to != null) {
                return Expressions.booleanOperation(Ops.LOE, mixin, ConstantImpl.create(to));
            } else {
                throw new IllegalArgumentException("Either from or to needs to be non-null");
            }
        } else if (to == null) {
            return Expressions.booleanOperation(Ops.GOE, mixin, ConstantImpl.create(from));
        } else {
            return Expressions.booleanOperation(Ops.BETWEEN, mixin, ConstantImpl.create(from), ConstantImpl.create(to));
        }
    }
Create a {@code this between from and to} expression

<p>Is equivalent to {@code from <= this <= to}</p>

@param from inclusive start of range
@param to inclusive end of range
@return this between from and to
querydsl-core/src/main/java/com/querydsl/core/types/dsl/ComparableExpression.java