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

org.scassandra.cql.CqlTimestamp Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package org.scassandra.cql;

import java.util.Date;

public class CqlTimestamp extends PrimitiveType {
    CqlTimestamp() {
        super("timestamp");
    }

    @Override
    public boolean equals(Object expected, Object actual) {
        Long typedActualValue = getActualValueLong(actual);

        if (expected == null) return actual == null;
        if (actual == null) return expected == null;

        if (expected instanceof Long) {
            return expected.equals(typedActualValue);
        } else if (expected instanceof Date) {
            return ((Date) expected).getTime() == typedActualValue;
        }

        throw throwInvalidType(expected, actual, this);

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy