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 aConsumption4Unit
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconsumptionClass
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static void
process
(Resource resource, Block block, int periodicity, int yearFrom, int yearTo, Consumer<Consumption4Unit<?>> processor) resource()
Returns the value of theresource
record component.final String
toString()
Returns a string representation of this record class.unit()
Returns the value of theunit
record component.int
yearFrom()
Returns the value of theyearFrom
record component.int
yearTo()
Returns the value of theyearTo
record component.
-
Constructor Details
-
Consumption4Unit
public Consumption4Unit(Class<C> consumptionClass, Resource resource, AbstractUnit unit, int yearFrom, int yearTo) Creates an instance of aConsumption4Unit
record class.- Parameters:
consumptionClass
- the value for theconsumptionClass
record componentresource
- the value for theresource
record componentunit
- the value for theunit
record componentyearFrom
- the value for theyearFrom
record componentyearTo
- the value for theyearTo
record 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 theresource
record component.- Returns:
- the value of the
resource
record component
-
unit
Returns the value of theunit
record component.- Returns:
- the value of the
unit
record component
-
yearFrom
public int yearFrom()Returns the value of theyearFrom
record component.- Returns:
- the value of the
yearFrom
record component
-
yearTo
public int yearTo()Returns the value of theyearTo
record component.- Returns:
- the value of the
yearTo
record component
-