Package org.kiwiproject.consul.option
Class ImmutablePutOptions
java.lang.Object
org.kiwiproject.consul.option.PutOptions
org.kiwiproject.consul.option.ImmutablePutOptions
- All Implemented Interfaces:
ParamAdder
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutablePutOptions
extends PutOptions
Immutable implementation of
PutOptions.
Use the builder to create immutable instances:
ImmutablePutOptions.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutablePutOptions. -
Field Summary
Fields inherited from class org.kiwiproject.consul.option.PutOptions
BLANK -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutablePutOptions.Builderbuilder()Creates a builder forImmutablePutOptions.static ImmutablePutOptionscopyOf(PutOptions instance) Creates an immutable copy of aPutOptionsvalue.booleanThis instance is equal to all instances ofImmutablePutOptionsthat have equal attribute values.getCas()getDc()getToken()inthashCode()Computes a hash code from attributes:toQueryParameters,toHeaders,cas,acquire,release,dc,token.com.google.common.collect.ImmutableList<String>toString()Prints the immutable valuePutOptionswith attribute values.final ImmutablePutOptionswithAcquire(String value) Copy the current immutable object by setting a present value for the optionalacquireattribute.final ImmutablePutOptionswithAcquire(Optional<String> optional) Copy the current immutable object by setting an optional value for theacquireattribute.final ImmutablePutOptionswithCas(long value) Copy the current immutable object by setting a present value for the optionalcasattribute.final ImmutablePutOptionsCopy the current immutable object by setting an optional value for thecasattribute.final ImmutablePutOptionsCopy the current immutable object by setting a present value for the optionaldcattribute.final ImmutablePutOptionsCopy the current immutable object by setting an optional value for thedcattribute.final ImmutablePutOptionswithRelease(String value) Copy the current immutable object by setting a present value for the optionalreleaseattribute.final ImmutablePutOptionswithRelease(Optional<String> optional) Copy the current immutable object by setting an optional value for thereleaseattribute.final ImmutablePutOptionswithToHeaders(Map<String, ? extends String> entries) Copy the current immutable object by replacing thetoHeadersmap with the specified map.final ImmutablePutOptionsCopy the current immutable object by setting a present value for the optionaltokenattribute.final ImmutablePutOptionsCopy the current immutable object by setting an optional value for thetokenattribute.final ImmutablePutOptionswithToQueryParameters(Iterable<String> elements) Copy the current immutable object with elements that replace the content oftoQueryParameters.final ImmutablePutOptionswithToQueryParameters(String... elements) Copy the current immutable object with elements that replace the content oftoQueryParameters.Methods inherited from class org.kiwiproject.consul.option.PutOptions
toQuery
-
Method Details
-
toQueryParameters
- Returns:
- The value of the
toQueryParametersattribute
-
toHeaders
- Returns:
- The value of the
toHeadersattribute
-
getCas
- Specified by:
getCasin classPutOptions- Returns:
- The value of the
casattribute
-
getAcquire
- Specified by:
getAcquirein classPutOptions- Returns:
- The value of the
acquireattribute
-
getRelease
- Specified by:
getReleasein classPutOptions- Returns:
- The value of the
releaseattribute
-
getDc
- Specified by:
getDcin classPutOptions- Returns:
- The value of the
dcattribute
-
getToken
- Specified by:
getTokenin classPutOptions- Returns:
- The value of the
tokenattribute
-
withToQueryParameters
Copy the current immutable object with elements that replace the content oftoQueryParameters.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withToQueryParameters
Copy the current immutable object with elements that replace the content oftoQueryParameters. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of toQueryParameters elements to set- Returns:
- A modified copy of
thisobject
-
withToHeaders
Copy the current immutable object by replacing thetoHeadersmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the toHeaders map- Returns:
- A modified copy of
thisobject
-
withCas
Copy the current immutable object by setting a present value for the optionalcasattribute.- Parameters:
value- The value for cas- Returns:
- A modified copy of
thisobject
-
withCas
Copy the current immutable object by setting an optional value for thecasattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for cas- Returns:
- A modified copy of
thisobject
-
withAcquire
Copy the current immutable object by setting a present value for the optionalacquireattribute.- Parameters:
value- The value for acquire- Returns:
- A modified copy of
thisobject
-
withAcquire
Copy the current immutable object by setting an optional value for theacquireattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for acquire- Returns:
- A modified copy of
thisobject
-
withRelease
Copy the current immutable object by setting a present value for the optionalreleaseattribute.- Parameters:
value- The value for release- Returns:
- A modified copy of
thisobject
-
withRelease
Copy the current immutable object by setting an optional value for thereleaseattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for release- Returns:
- A modified copy of
thisobject
-
withDc
Copy the current immutable object by setting a present value for the optionaldcattribute.- Parameters:
value- The value for dc- Returns:
- A modified copy of
thisobject
-
withDc
Copy the current immutable object by setting an optional value for thedcattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for dc- Returns:
- A modified copy of
thisobject
-
withToken
Copy the current immutable object by setting a present value for the optionaltokenattribute.- Parameters:
value- The value for token- Returns:
- A modified copy of
thisobject
-
withToken
Copy the current immutable object by setting an optional value for thetokenattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for token- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutablePutOptionsthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:toQueryParameters,toHeaders,cas,acquire,release,dc,token. -
toString
Prints the immutable valuePutOptionswith attribute values. -
copyOf
Creates an immutable copy of aPutOptionsvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable PutOptions instance
-
builder
Creates a builder forImmutablePutOptions.ImmutablePutOptions.builder() .addToQueryParameters|addAllToQueryParameters(String) //toQueryParameterselements .putToHeaders|putAllToHeaders(String => String) //toHeadersmappings .cas(Long) // optionalcas.acquire(String) // optionalacquire.release(String) // optionalrelease.dc(String) // optionaldc.token(String) // optionaltoken.build();- Returns:
- A new ImmutablePutOptions builder
-