Package com.storedobject.iot
Class MonthlyConsumption
- All Implemented Interfaces:
Displayable
,StringFiller
,DBTransaction.NoHistory
,HasId
Represents a monthly consumption entity that extends the base Consumption class.
This class provides functionality to handle data specific to a single month's consumption,
including retrieving, navigating, and setting details about the monthly period.
- Author:
- Syam
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Configures the columns for the data representation of the entity.int
getMonth()
Retrieves the value of the month corresponding to this instance of MonthlyConsumption.int
Retrieves the period associated with the monthly consumption.Retrieves the detailed representation of the consumption period in the format of "Month Year".Retrieves the type of period associated with the consumption instance.static void
Configures the indices for the MonthlyConsumption class.next()
Retrieves the nextMonthlyConsumption
object, advancing to the subsequent month.previous()
Retrieves the MonthlyConsumption instance representing the previous month relative to the current instance.void
setMonth
(int month) Sets the month value for the current instance.Methods inherited from class com.storedobject.iot.Consumption
getConsumption, getItem, getItemId, getPeriodName, getResource, getResourceId, getYear, setConsumption, setItem, setItem, setItem, setResource, setResource, setResource, setYear, toDisplay, validateData
Methods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getAttachment, getAttachmentId, getChildren, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, getUniqueCondition, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saved, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, toString, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildAttach, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
MonthlyConsumption
public MonthlyConsumption()Default constructor for the MonthlyConsumption class. Initializes a new instance of the MonthlyConsumption entity, which is used to represent and manage the consumption details for a specific month.
-
-
Method Details
-
columns
Configures the columns for the data representation of the entity. Adds a column labeled "Month" of type "int".- Parameters:
columns
- the Columns object used to define and manage the data columns
-
indices
Configures the indices for the MonthlyConsumption class. This method adds a composite index consisting of the fields "Item", "Resource", "Year", and "Month". The index is marked as unique.- Parameters:
indices
- the Indices object to which the index configuration will be added
-
setMonth
public void setMonth(int month) Sets the month value for the current instance.- Parameters:
month
- the month value to set, represented as an integer (1 for January up to 12 for December)
-
getMonth
-
getPeriod
public int getPeriod()Retrieves the period associated with the monthly consumption. The period is represented as an integer value corresponding to the month.- Specified by:
getPeriod
in classConsumption<PeriodType>
- Returns:
- the month of the period as an integer, where 1 represents January and 12 represents December.
-
getPeriodDetail
Retrieves the detailed representation of the consumption period in the format of "Month Year". The month is derived from the internal state of the class and represented as the corresponding month name (e.g., "January", "February"). The year is retrieved using theConsumption.getYear()
method.- Specified by:
getPeriodDetail
in classConsumption<PeriodType>
- Returns:
- a string representing the period detail, combining the name of the month and the year.
-
previous
Retrieves the MonthlyConsumption instance representing the previous month relative to the current instance. If the current month is January, it shifts to December of the previous year.- Specified by:
previous
in classConsumption<PeriodType>
- Returns:
- the MonthlyConsumption instance for the previous month.
-
next
Retrieves the nextMonthlyConsumption
object, advancing to the subsequent month. If the current month is December, the method transitions to January of the next year.- Specified by:
next
in classConsumption<PeriodType>
- Returns:
- the
MonthlyConsumption
object for the next month, based on the current month and year.
-
getPeriodType
Description copied from class:Consumption
Retrieves the type of period associated with the consumption instance. The period type is expected to represent an interval such as HOURLY, DAILY, WEEKLY, MONTHLY, or YEARLY, as defined in thePeriodType
enum.- Specified by:
getPeriodType
in classConsumption<PeriodType>
- Returns:
- The
PeriodType
indicating the interval type for this consumption instance.
-