SimpleExpression<T> getValue() {
        if (value == null) {
            if (orderBy.isEmpty()) {
                // TODO this check should be static
                throw new IllegalStateException("No order by arguments given");
            }
            List<Expression<?>> args = new ArrayList<>();
            StringBuilder builder = new StringBuilder();
            builder.append("{0} keep (dense_rank ");
            args.add(target);
            builder.append(first ? "first " : "last ");
            builder.append(ORDER_BY);
            builder.append("{1}");
            args.add(ExpressionUtils.orderBy(orderBy));
            builder.append(")");
            value = Expressions.template(target.getType(), builder.toString(), CollectionUtils.unmodifiableList(args));
        }
        return value;
    }
{@code WindowFirstLast} is a builder for window function expressions

@author tiwe

@param <T>
querydsl-sql/src/main/java/com/querydsl/sql/WindowFirstLast.java