org.flexiblepower.ral.values
public static final class CommodityProfile.Builder extends java.lang.Object
CommodityProfiles.| Modifier and Type | Method and Description |
|---|---|
CommodityProfile.Builder |
add(CommodityMeasurables commodityMeasurable) |
CommodityProfile.Builder |
add(Profile.Element<CommodityMeasurables> element) |
CommodityProfile |
build() |
CommodityProfile.Builder |
duration(javax.measure.Measurable<javax.measure.quantity.Duration> duration)
Set the duration and saves it for future creation of elements.
|
CommodityProfile.Builder |
electricity(javax.measure.Measurable<javax.measure.quantity.Power> value)
Set the electricity value and saves it for future creation of elements.
|
CommodityProfile.Builder |
gas(javax.measure.Measurable<javax.measure.quantity.VolumetricFlowRate> value)
Set the gas value and saves it for future creation of elements.
|
CommodityProfile.Builder |
heat(javax.measure.Measurable<javax.measure.quantity.Power> value)
Set the heat value and saves it for future creation of elements.
|
CommodityProfile.Builder |
next()
Uses the values as set by the
duration(Measurable), electricity(Measurable),
gas(Measurable) and heat(Measurable) methods to create a new element. |
public CommodityProfile.Builder duration(javax.measure.Measurable<javax.measure.quantity.Duration> duration)
duration - The duration for the elementnext()public CommodityProfile.Builder electricity(javax.measure.Measurable<javax.measure.quantity.Power> value)
value - The electricity value for the elementnext()public CommodityProfile.Builder gas(javax.measure.Measurable<javax.measure.quantity.VolumetricFlowRate> value)
value - The gas value for the elementnext()public CommodityProfile.Builder heat(javax.measure.Measurable<javax.measure.quantity.Power> value)
value - The heat value for the elementnext()public CommodityProfile.Builder next()
duration(Measurable), electricity(Measurable),
gas(Measurable) and heat(Measurable) methods to create a new element. This does not reset
the values, so if you call this method again it will create a second element that is equal to the first.java.lang.IllegalArgumentException - when the duration has not been set using duration(Measurable)public CommodityProfile.Builder add(Profile.Element<CommodityMeasurables> element)
element - The element that needs to be added.public CommodityProfile.Builder add(CommodityMeasurables commodityMeasurable)
commodityMeasurable - The CommodityMeasurables that will be used (together with the set duration) to add a new
element.java.lang.IllegalArgumentException - when the duration has not been set using duration(Measurable)public CommodityProfile build()