public static final class AggregatedBid.Builder
extends java.lang.Object
AggregatedBid. The idea is that you can call the
addAgentBid(String, BidUpdate) or addBid(Bid) several times to define the AggregatedBid
. When calling the build() method it returns the created aggregated bid and this AggregatedBid.Builder should
not be used after that.
Example usage:
AggregateBid bid = new AggregatedBid.Builder(marketBasis).addAgentBid("agent1", bid1)
.addAgentBid("agent2", bid2)
.build();
This class is not thread-safe.| Constructor and Description |
|---|
AggregatedBid.Builder(MarketBasis marketBasis)
Creates a new
AggregatedBid.Builder that should be used to generate a new AggregatedBid. |
| Modifier and Type | Method and Description |
|---|---|
AggregatedBid.Builder |
addAgentBid(java.lang.String agentId,
BidUpdate bidUpdate)
Adds the bid of an agent.
|
AggregatedBid.Builder |
addBid(Bid bid) |
AggregatedBid |
build() |
public AggregatedBid.Builder(MarketBasis marketBasis)
AggregatedBid.Builder that should be used to generate a new AggregatedBid.marketBasis - The MarketBasis that is used to base the new AggregatedBid on.public AggregatedBid.Builder addAgentBid(java.lang.String agentId, BidUpdate bidUpdate)
agentId - The unqiue identifier of the agent that has sent the bid.bidUpdate - The bidUpdate that has to be added to the aggregated bid.AggregatedBid.Builderpublic AggregatedBid.Builder addBid(Bid bid)
public AggregatedBid build()
AggregatedBid object that contains all the added bids. After this method has been
called, the AggregatedBid.Builder should not be used any further.