com.kolibrifx.plovercrest.server.internal.folds.Timestamped Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plovercrest-server Show documentation
Show all versions of plovercrest-server Show documentation
Plovercrest server library.
The newest version!
/*
* Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
*/
package com.kolibrifx.plovercrest.server.internal.folds;
/**
* Small wrapper for a timestamp and a value. Useful for fold logic that needs to re-timestamp
* messages, such as resampling.
*/
public final class Timestamped {
private final long timestamp;
private final T value;
public Timestamped(final long timestamp, final T value) {
this.timestamp = timestamp;
this.value = value;
}
public long getTimestamp() {
return timestamp;
}
public T getValue() {
return value;
}
@Override
public String toString() {
return "Timestamped [timestamp=" + timestamp + ", value=" + value + "]";
}
}