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

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

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

import cn.wjybxx.dson.types.OffsetTimestamp;

import javax.annotation.Nonnull;

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

    private final OffsetTimestamp value;

    public DsonTimestamp(OffsetTimestamp value) {
        this.value = value;
    }

    public OffsetTimestamp getValue() {
        return value;
    }

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

    //region equals

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

        DsonTimestamp that = (DsonTimestamp) o;

        return value.equals(that.value);
    }

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

    // endregion

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy