Package com.orbitz.consul.option
Class ImmutablePutOptions
- java.lang.Object
-
- com.orbitz.consul.option.PutOptions
-
- com.orbitz.consul.option.ImmutablePutOptions
-
- All Implemented Interfaces:
ParamAdder
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePutOptions extends PutOptionsImmutable implementation ofPutOptions.Use the builder to create immutable instances:
ImmutablePutOptions.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePutOptions.BuilderBuilds instances of typeImmutablePutOptions.
-
Field Summary
-
Fields inherited from class com.orbitz.consul.option.PutOptions
BLANK
-
-
Method Summary
Modifier and Type Method Description static ImmutablePutOptions.Builderbuilder()Creates a builder forImmutablePutOptions.static ImmutablePutOptionscopyOf(PutOptions instance)Creates an immutable copy of aPutOptionsvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutablePutOptionsthat have equal attribute values.java.util.Optional<java.lang.String>getAcquire()java.util.Optional<java.lang.Long>getCas()java.util.Optional<java.lang.String>getDc()java.util.Optional<java.lang.String>getRelease()java.util.Optional<java.lang.String>getToken()inthashCode()Computes a hash code from attributes:toHeaders,cas,acquire,release,dc,token.com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>toHeaders()java.lang.StringtoString()Prints the immutable valuePutOptionswith attribute values.ImmutablePutOptionswithAcquire(java.lang.String value)Copy the current immutable object by setting a present value for the optionalacquireattribute.ImmutablePutOptionswithAcquire(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for theacquireattribute.ImmutablePutOptionswithCas(long value)Copy the current immutable object by setting a present value for the optionalcasattribute.ImmutablePutOptionswithCas(java.util.Optional<java.lang.Long> optional)Copy the current immutable object by setting an optional value for thecasattribute.ImmutablePutOptionswithDc(java.lang.String value)Copy the current immutable object by setting a present value for the optionaldcattribute.ImmutablePutOptionswithDc(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thedcattribute.ImmutablePutOptionswithRelease(java.lang.String value)Copy the current immutable object by setting a present value for the optionalreleaseattribute.ImmutablePutOptionswithRelease(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thereleaseattribute.ImmutablePutOptionswithToHeaders(java.util.Map<java.lang.String,? extends java.lang.String> entries)Copy the current immutable object by replacing thetoHeadersmap with the specified map.ImmutablePutOptionswithToken(java.lang.String value)Copy the current immutable object by setting a present value for the optionaltokenattribute.ImmutablePutOptionswithToken(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thetokenattribute.-
Methods inherited from class com.orbitz.consul.option.PutOptions
toQuery
-
-
-
-
Method Detail
-
toHeaders
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> toHeaders()
- Returns:
- The value of the
toHeadersattribute
-
getCas
public java.util.Optional<java.lang.Long> getCas()
- Specified by:
getCasin classPutOptions- Returns:
- The value of the
casattribute
-
getAcquire
public java.util.Optional<java.lang.String> getAcquire()
- Specified by:
getAcquirein classPutOptions- Returns:
- The value of the
acquireattribute
-
getRelease
public java.util.Optional<java.lang.String> getRelease()
- Specified by:
getReleasein classPutOptions- Returns:
- The value of the
releaseattribute
-
getDc
public java.util.Optional<java.lang.String> getDc()
- Specified by:
getDcin classPutOptions- Returns:
- The value of the
dcattribute
-
getToken
public java.util.Optional<java.lang.String> getToken()
- Specified by:
getTokenin classPutOptions- Returns:
- The value of the
tokenattribute
-
withToHeaders
public final ImmutablePutOptions withToHeaders(java.util.Map<java.lang.String,? extends java.lang.String> entries)
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
public final ImmutablePutOptions withCas(long value)
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
public final ImmutablePutOptions withCas(java.util.Optional<java.lang.Long> optional)
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
public final ImmutablePutOptions withAcquire(java.lang.String value)
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
public final ImmutablePutOptions withAcquire(java.util.Optional<java.lang.String> optional)
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
public final ImmutablePutOptions withRelease(java.lang.String value)
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
public final ImmutablePutOptions withRelease(java.util.Optional<java.lang.String> optional)
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
public final ImmutablePutOptions withDc(java.lang.String value)
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
public final ImmutablePutOptions withDc(java.util.Optional<java.lang.String> optional)
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
public final ImmutablePutOptions withToken(java.lang.String value)
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
public final ImmutablePutOptions withToken(java.util.Optional<java.lang.String> optional)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutablePutOptionsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:toHeaders,cas,acquire,release,dc,token.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valuePutOptionswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutablePutOptions copyOf(PutOptions instance)
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
public static ImmutablePutOptions.Builder builder()
Creates a builder forImmutablePutOptions.ImmutablePutOptions.builder() .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
-
-