Package com.storedobject.ui.iot
Record Class Consumption4Unit<C extends Consumption<?>>
java.lang.Object
java.lang.Record
com.storedobject.ui.iot.Consumption4Unit<C>
public record Consumption4Unit<C extends Consumption<?>>(Class<C extends Consumption<?>> consumptionClass, Resource resource, AbstractUnit unit, int yearFrom, int yearTo)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionConsumption4Unit(Class<C> consumptionClass, Resource resource, AbstractUnit unit, int yearFrom, int yearTo) Creates an instance of aConsumption4Unitrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconsumptionClassrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static voidprocess(Resource resource, Block block, int periodicity, int yearFrom, int yearTo, Consumer<Consumption4Unit<?>> processor) resource()Returns the value of theresourcerecord component.final StringtoString()Returns a string representation of this record class.unit()Returns the value of theunitrecord component.intyearFrom()Returns the value of theyearFromrecord component.intyearTo()Returns the value of theyearTorecord component.
-
Constructor Details
-
Consumption4Unit
public Consumption4Unit(Class<C> consumptionClass, Resource resource, AbstractUnit unit, int yearFrom, int yearTo) Creates an instance of aConsumption4Unitrecord class.- Parameters:
consumptionClass- the value for theconsumptionClassrecord componentresource- the value for theresourcerecord componentunit- the value for theunitrecord componentyearFrom- the value for theyearFromrecord componentyearTo- the value for theyearTorecord component
-
-
Method Details
-
process
public static void process(Resource resource, Block block, int periodicity, int yearFrom, int yearTo, Consumer<Consumption4Unit<?>> processor) -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
consumptionClass
-
resource
Returns the value of theresourcerecord component.- Returns:
- the value of the
resourcerecord component
-
unit
Returns the value of theunitrecord component.- Returns:
- the value of the
unitrecord component
-
yearFrom
public int yearFrom()Returns the value of theyearFromrecord component.- Returns:
- the value of the
yearFromrecord component
-
yearTo
public int yearTo()Returns the value of theyearTorecord component.- Returns:
- the value of the
yearTorecord component
-