org.flexiblepower.ral.values
public static class CommoditySet.Builder extends java.lang.Object
This helper class makes it easy to create an instance of the CommoditySet
. To create an instance of this
class, use CommoditySet.create()
.
Typical usage looks like this:
CommoditySet commoditySet = CommoditySet.create().addElectricity().addGas().build();
Constructor and Description |
---|
CommoditySet.Builder() |
Modifier and Type | Method and Description |
---|---|
CommoditySet.Builder |
add(Commodity<?,?> commodity)
Adds the selected
Commodity to the set. |
CommoditySet.Builder |
addElectricity()
Adds
Commodity.ELECTRICITY to the set. |
CommoditySet.Builder |
addGas()
Adds
Commodity.GAS to the set. |
CommoditySet.Builder |
addHeat()
Adds
Commodity.HEAT to the set. |
CommoditySet |
build() |
public CommoditySet.Builder add(Commodity<?,?> commodity)
Commodity
to the set.commodity
- The commodity that should be added.public CommoditySet.Builder addElectricity()
Commodity.ELECTRICITY
to the set.public CommoditySet.Builder addGas()
Commodity.GAS
to the set.public CommoditySet.Builder addHeat()
Commodity.HEAT
to the set.public CommoditySet build()
CommoditySet
that contains the set commodities.