com.bigdata.counters.OneShotInstrument Maven / Gradle / Ivy
package com.bigdata.counters;
/**
* An {@link Instrument} that records a single value at the moment that it
* is constructed and always reports the same value and lastModified time.
*
* @author Bryan Thompson
* @version $Id$
* @param
*/
public class OneShotInstrument implements IInstrument {
private final T value;
private long lastModified = System.currentTimeMillis();
public OneShotInstrument(T value) {
this.value = value;
}
public T getValue() {
return value;
}
public long lastModified() {
return lastModified;
}
/**
* @throws UnsupportedOperationException
* always
*/
public void setValue(T value, long timestamp) {
throw new UnsupportedOperationException();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy