net.intelie.pipes.time.TimestampSpan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pipes-api Show documentation
Show all versions of pipes-api Show documentation
Intelie Pipes' API classes and interfaces
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);
}
}