Class AbstractDeviceStatistics
- java.lang.Object
-
- com.github.kaklakariada.fritzbox.model.homeautomation.AbstractDeviceStatistics
-
- Direct Known Subclasses:
Energy,Humidity,Power,Temperature,Voltage
public abstract class AbstractDeviceStatistics extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description AbstractDeviceStatistics()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Optional<Statistics>getStatisticsByGrid(int grid)Supply the Statistics gathered for a chosen gridabstract java.util.List<Statistics>getStats()All classes implementing this abstract class need to provide a "getStats"-methodprotected java.util.List<Statistics>getStats(java.util.List<Statistics> stats, MeasurementUnit measurementUnit)AVM gathers just integer numbers.protected abstract java.util.List<java.lang.String>statisticsToString()All classes implementing this abstract class need to provide a "statisticsToString"-methodprotected java.util.List<java.lang.String>statisticsToString(java.lang.String type)
-
-
-
Method Detail
-
getStatisticsByGrid
public java.util.Optional<Statistics> getStatisticsByGrid(int grid)
Supply the Statistics gathered for a chosen grid- Parameters:
grid- grid- Returns:
- Optional - avoid NPE if no statistics present
-
getStats
public abstract java.util.List<Statistics> getStats()
All classes implementing this abstract class need to provide a "getStats"-method- Returns:
- List
-
getStats
protected java.util.List<Statistics> getStats(java.util.List<Statistics> stats, MeasurementUnit measurementUnit)
AVM gathers just integer numbers. We know the precision only from documentation, it is never provided by returned responses from Fritz!Box. So we add this information here to the statistics.- Parameters:
stats- statistics to which to add the measurment unitmeasurementUnit- the unit to add to the statistics- Returns:
- statistics with measurement units
-
statisticsToString
protected abstract java.util.List<java.lang.String> statisticsToString()
All classes implementing this abstract class need to provide a "statisticsToString"-method- Returns:
- List
-
statisticsToString
protected java.util.List<java.lang.String> statisticsToString(java.lang.String type)
- Parameters:
type- statistics type- Returns:
- statistics as one line per grid
-
-