@NotThreadSafe public static final class HttpResultWrapper.Builder<T,E> extends Object
HttpResultWrapper.
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 |
|---|---|
HttpResultWrapper<T,E> |
build()
Builds a new
HttpResultWrapper. |
HttpResultWrapper.Builder<T,E> |
from(AbstractHttpResultWrapper<T,E> instance)
Fill a builder with attribute values from the provided
AbstractHttpResultWrapper instance. |
HttpResultWrapper.Builder<T,E> |
setErrResultMaybe(E errResultMaybe)
Initializes the optional value
errResultMaybe to errResultMaybe. |
HttpResultWrapper.Builder<T,E> |
setErrResultMaybe(Optional<E> errResultMaybe)
Initializes the optional value
errResultMaybe to errResultMaybe. |
HttpResultWrapper.Builder<T,E> |
setHttpStatusCode(int httpStatusCode)
Initializes the value for the
httpStatusCode attribute. |
HttpResultWrapper.Builder<T,E> |
setOkResultMaybe(Optional<T> okResultMaybe)
Initializes the optional value
okResultMaybe to okResultMaybe. |
HttpResultWrapper.Builder<T,E> |
setOkResultMaybe(T okResultMaybe)
Initializes the optional value
okResultMaybe to okResultMaybe. |
public final HttpResultWrapper.Builder<T,E> from(AbstractHttpResultWrapper<T,E> instance)
AbstractHttpResultWrapper 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 HttpResultWrapper.Builder<T,E> setOkResultMaybe(@Nullable T okResultMaybe)
okResultMaybe to okResultMaybe.okResultMaybe - The value for okResultMaybe, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final HttpResultWrapper.Builder<T,E> setOkResultMaybe(Optional<T> okResultMaybe)
okResultMaybe to okResultMaybe.okResultMaybe - The value for okResultMaybethis builder for use in a chained invocationpublic final HttpResultWrapper.Builder<T,E> setErrResultMaybe(@Nullable E errResultMaybe)
errResultMaybe to errResultMaybe.errResultMaybe - The value for errResultMaybe, null is accepted as java.util.Optional.empty()this builder for chained invocationpublic final HttpResultWrapper.Builder<T,E> setErrResultMaybe(Optional<E> errResultMaybe)
errResultMaybe to errResultMaybe.errResultMaybe - The value for errResultMaybethis builder for use in a chained invocationpublic final HttpResultWrapper.Builder<T,E> setHttpStatusCode(int httpStatusCode)
httpStatusCode attribute.
If not set, this attribute will have a default value as returned by the initializer of httpStatusCode.
httpStatusCode - The value for httpStatusCodethis builder for use in a chained invocationpublic HttpResultWrapper<T,E> build() throws com.hubspot.immutables.exceptions.InvalidImmutableStateException
HttpResultWrapper.com.hubspot.immutables.exceptions.InvalidImmutableStateException - if any required attributes are missingCopyright © 2018. All rights reserved.