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

com.vesoft.nebula.driver.graph.data.NDate Maven / Gradle / Ivy

The newest version!
package com.vesoft.nebula.driver.graph.data;

import com.vesoft.nebula.proto.common.Date;
import java.util.Objects;

public class NDate {
    private final Date date;

    public NDate(Date date) {
        this.date = date;
    }

    public int getYear() {
        return date.getYear();
    }

    public int getMonth() {
        return date.getMonth();
    }

    public int getDay() {
        return date.getDay();
    }

    @Override
    public String toString() {
        return String.format("%d-%02d-%02d", date.getYear(), date.getMonth(), date.getDay());
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        NDate that = (NDate) o;
        return date.getYear() == that.getYear()
                && date.getMonth() == that.getMonth()
                && date.getDay() == that.getDay();
    }

    @Override
    public int hashCode() {
        return Objects.hash(date);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy