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

org.nohope.cassandra.mapservice.COrdering Maven / Gradle / Ivy

The newest version!
package org.nohope.cassandra.mapservice;

import com.datastax.driver.core.querybuilder.Ordering;
import org.nohope.cassandra.mapservice.columns.CColumn;

/**
 */
public final class COrdering {
    private final CColumn column;
    private final Orderings asc;

    public COrdering(final CColumn column,
                     final Orderings ordering) {
        this.column = column;
        this.asc = ordering;
    }

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

    @Override
    public int hashCode() {
        int result = column.hashCode();
        result = (31 * result) + asc.hashCode();
        return result;
    }

    public Ordering ordering() {
        return asc.forColumn(column);
    }

    CColumn getColumn() {
        return column;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy