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

com.kolibrifx.plovercrest.server.internal.folds.Timestamped Maven / Gradle / Ivy

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 + "]";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy