public static <T extends Enum<T>> EnumExpression<T> asEnum(Expression<T> expr) {
        Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
        if (underlyingMixin instanceof PathImpl) {
            return new EnumPath<T>((PathImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof OperationImpl) {
            return new EnumOperation<T>((OperationImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof TemplateExpressionImpl) {
            return new EnumTemplate<T>((TemplateExpressionImpl<T>) underlyingMixin);
        } else {
            return new EnumExpression<T>(underlyingMixin) {

                private static final long serialVersionUID = 949681836002045152L;

                @Override
                public <R, C> R accept(Visitor<R, C> v, C context) {
                    return this.mixin.accept(v, context);
                }

                @Override
                public boolean equals(Object o) {
                    if (o == this) {
                        return true;
                    } else if (o instanceof EnumExpression) {
                        EnumExpression other = (EnumExpression) o;
                        return (other.mixin.equals(this.mixin));
                    } else {
                        return false;
                    }
                }

            };
        }

    }
Create a new EnumExpression

@param expr Expression of type Enum
@return new EnumExpression
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java