All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enonic.xp.query.expr.OrderExpr Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.query.expr;

import com.enonic.xp.annotation.PublicApi;

@PublicApi
public abstract class OrderExpr
    implements Expression
{
    public enum Direction
    {
        ASC, DESC
    }

    private final Direction direction;

    public OrderExpr( final Direction direction )
    {
        this.direction = direction;
    }

    public final Direction getDirection()
    {
        return this.direction;
    }

    @Override
    public abstract String toString();

    @Override
    public boolean equals( final Object o )
    {
        if ( this == o )
        {
            return true;
        }
        if ( o == null || getClass() != o.getClass() )
        {
            return false;
        }

        final OrderExpr orderExpr = (OrderExpr) o;

        return direction == orderExpr.direction;
    }

    @Override
    public int hashCode()
    {
        return direction != null ? direction.hashCode() : 0;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy