Class Consumption<P extends PeriodType>

java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.iot.Consumption<P>
All Implemented Interfaces:
Displayable, StringFiller, DBTransaction.NoHistory, HasId
Direct Known Subclasses:
DailyConsumption, HourlyConsumption, MonthlyConsumption, WeeklyConsumption, YearlyConsumption

public abstract class Consumption<P extends PeriodType> extends StoredObject implements DBTransaction.NoHistory
Represents consumption data associated with a specific resource, item, and a time period. This is an abstract class that provides a framework for subclasses to define consumption records over different periods, such as hourly, daily, weekly, monthly, or yearly.

The class enforces restrictions on setting certain attributes while not loading, and ensures data consistency and correctness through validations and relationships with related entities. Consumption values can also be updated and adjusted incrementally.

Author:
Syam