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

net.intelie.pipes.time.TimestampSpan Maven / Gradle / Ivy

There is a newer version: 0.25.5
Show newest version
package net.intelie.pipes.time;

import java.time.ZoneId;
import java.util.Objects;

public class TimestampSpan extends TimeSpanBase {
    private static final long serialVersionUID = 1L;
    private final long timestamp;

    public TimestampSpan(long timestamp) {
        super("timestamp " + timestamp);
        this.timestamp = timestamp;
    }

    @Override
    public TimestampSpan forceZone(ZoneId zone) {
        return new TimestampSpan(timestamp);
    }

    @Override
    public long start(long reference) {
        return timestamp;
    }

    @Override
    public long end(long reference) {
        return timestamp;
    }

    @Override
    public boolean isFixed() {
        return true;
    }

    @Override
    public boolean isPoint() {
        return true;
    }

    @Override
    public boolean includesPresent() {
        return false;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof TimestampSpan)) return false;

        TimestampSpan that = (TimestampSpan) o;

        return Objects.equals(this.timestamp, that.timestamp);
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy