@@ -0,0 +1,919 @@
+package pro.panopticon.client.sensor.impl;%0A%0Aimport pro.panopticon.client.model.Measurement;%0Aimport pro.panopticon.client.sensor.Sensor;%0A%0Aimport java.time.LocalDateTime;%0Aimport java.time.temporal.TemporalAmount;%0Aimport java.util.List;%0A%0Apublic abstract class CachedSensor implements Sensor %7B%0A%0A    private TemporalAmount cacheTime;%0A%0A    private LocalDateTime lastFetchTime;%0A    private List%3CMeasurement%3E cachedValue;%0A%0A    public CachedSensor(TemporalAmount cacheTime) %7B%0A        this.cacheTime = cacheTime;%0A    %7D%0A%0A    public abstract List%3CMeasurement%3E calculateMeasurementsForCaching();%0A%0A    @Override%0A    public List%3CMeasurement%3E measure() %7B%0A        if (lastFetchTime == null %7C%7C cachedValue == null %7C%7C lastFetchTime.isBefore(LocalDateTime.now().minus(cacheTime))) %7B%0A            cachedValue = calculateMeasurementsForCaching();%0A            lastFetchTime = LocalDateTime.now();%0A        %7D%0A        return cachedValue;%0A    %7D%0A%7D%0A

Implement cached sensor