Class BatchBuilder
- java.lang.Object
-
- com.aerisweather.aeris.communication.BatchBuilder
-
public class BatchBuilder extends Object
-
-
Constructor Summary
Constructors Constructor Description BatchBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchBuilder
addEndpoint(Endpoint endpoint)
Add an endpoint to the batch request.BatchBuilder
addEndpoint(EndpointType type)
Add an endpoint to the batch request.BatchBuilder
addEndpoint(EndpointType type, Action action)
Add an endpoint to the batch request.BatchBuilder
addGlobalParameter(Parameter param)
Add a parameter that will be applied to all of the requests.AerisRequest
build()
Builds the appropriate AerisRequest from the BatchBuilder.BatchBuilder
withAction(Action action)
Adds the batch Action to the builder.BatchBuilder
withId(String id)
Adds the batch id to the builder.
-
-
-
Method Detail
-
withId
public BatchBuilder withId(String id)
Adds the batch id to the builder. This cannot be used withwithAction(Action)
. An id or action must be passed.- Parameters:
id
- id to use for the batch request- Returns:
- the builder
-
withAction
public BatchBuilder withAction(Action action)
Adds the batch Action to the builder. This cannot be used withwithId(String)
. An id or action must be passed.- Parameters:
action
- action to use for the batch request- Returns:
- the builder
-
addEndpoint
public BatchBuilder addEndpoint(Endpoint endpoint)
Add an endpoint to the batch request.- Parameters:
endpoint
- endpoint to add- Returns:
- the builder.
-
addEndpoint
public BatchBuilder addEndpoint(EndpointType type)
Add an endpoint to the batch request.- Parameters:
type
- Endpoint type- Returns:
- BatchBuilder object
-
addEndpoint
public BatchBuilder addEndpoint(EndpointType type, Action action)
Add an endpoint to the batch request.- Parameters:
type
- Endpoint typeaction
- Action to take on the endpoint- Returns:
- BatchBuilder object
-
addGlobalParameter
public BatchBuilder addGlobalParameter(Parameter param)
Add a parameter that will be applied to all of the requests.- Parameters:
param
- parameter to apply- Returns:
- the builder
-
build
public AerisRequest build()
Builds the appropriate AerisRequest from the BatchBuilder.- Returns:
- AerisRequest based on builder
-
-