Interface MonthDataStorage
-
- All Superinterfaces:
PluginFeature
public interface MonthDataStorage extends PluginFeature
PluginFeaturethat provides a storage backend for month data. This class may keep the data on the local disk or on a backend server.YearMonthis used as key for loading and storing entries.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMonthDataStorage.ModelFactoryAMonthDataStorage.ModelFactoryallows creating new instances of the data model.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.time.YearMonth>getAvailableDataMonths()MonthDataStorage.ModelFactorygetModelFactory()java.util.Optional<MonthData>load(java.time.YearMonth month)java.util.List<MonthData>loadAll()voidstore(java.time.YearMonth month, MonthData data)Store the data for a given month.
-
-
-
Method Detail
-
load
java.util.Optional<MonthData> load(java.time.YearMonth month)
- Parameters:
month- the month for which to load the data.- Returns:
- the data for the given month.
-
store
void store(java.time.YearMonth month, MonthData data)Store the data for a given month.- Parameters:
month- the month.data- the data to store.
-
getAvailableDataMonths
java.util.List<java.time.YearMonth> getAvailableDataMonths()
- Returns:
- all months for that data is available in the store.
-
loadAll
java.util.List<MonthData> loadAll()
- Returns:
- all available data.
-
getModelFactory
MonthDataStorage.ModelFactory getModelFactory()
- Returns:
- the model factory that can be used to create instances of the model.
-
-