@NotThreadSafe public static final class HttpExchange.Builder extends Object
HttpExchange.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
HttpExchange |
build()
Builds a new
HttpExchange. |
HttpExchange.Builder |
from(HttpExchangeIF instance)
Fill a builder with attribute values from the provided
HttpExchangeIF instance. |
HttpExchange.Builder |
setExchangeDuration(Duration exchangeDuration)
Initializes the value for the
exchangeDuration attribute. |
HttpExchange.Builder |
setRequest(com.hubspot.horizon.HttpRequest request)
Initializes the value for the
request attribute. |
HttpExchange.Builder |
setResponse(com.hubspot.horizon.HttpResponse response)
Initializes the value for the
response attribute. |
public final HttpExchange.Builder from(HttpExchangeIF instance)
HttpExchangeIF instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final HttpExchange.Builder setRequest(com.hubspot.horizon.HttpRequest request)
request attribute.request - The value for requestthis builder for use in a chained invocationpublic final HttpExchange.Builder setResponse(com.hubspot.horizon.HttpResponse response)
response attribute.response - The value for responsethis builder for use in a chained invocationpublic final HttpExchange.Builder setExchangeDuration(Duration exchangeDuration)
exchangeDuration attribute.exchangeDuration - The value for exchangeDurationthis builder for use in a chained invocationpublic HttpExchange build() throws com.hubspot.immutables.validation.InvalidImmutableStateException
HttpExchange.com.hubspot.immutables.validation.InvalidImmutableStateException - if any required attributes are missingCopyright © 2020. All rights reserved.