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

cn.wjybxx.dson.DsonDateTime Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package cn.wjybxx.dson;

import cn.wjybxx.dson.types.ExtDateTime;

import javax.annotation.Nonnull;

/**
 * @author wjybxx
 * date - 2023/6/17
 */
public final class DsonDateTime extends DsonValue {

    private final ExtDateTime value;

    public DsonDateTime(ExtDateTime value) {
        this.value = value;
    }

    public ExtDateTime getValue() {
        return value;
    }

    @Nonnull
    @Override
    public DsonType getDsonType() {
        return DsonType.DATETIME;
    }

    //region equals

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

        DsonDateTime that = (DsonDateTime) o;

        return value.equals(that.value);
    }

    @Override
    public int hashCode() {
        return value.hashCode();
    }

    // endregion

    @Override
    public String toString() {
        return "DsonDateTime{" +
                "value=" + value +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy