Package org.kiwiproject.consul.option
Class ImmutableRoleOptions
java.lang.Object
org.kiwiproject.consul.option.RoleOptions
org.kiwiproject.consul.option.ImmutableRoleOptions
- All Implemented Interfaces:
ParamAdder
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableRoleOptions
extends RoleOptions
Immutable implementation of
RoleOptions.
Use the builder to create immutable instances:
ImmutableRoleOptions.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableRoleOptions. -
Field Summary
Fields inherited from class org.kiwiproject.consul.option.RoleOptions
BLANK -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableRoleOptions.Builderbuilder()Creates a builder forImmutableRoleOptions.static ImmutableRoleOptionscopyOf(RoleOptions instance) Creates an immutable copy of aRoleOptionsvalue.booleanThis instance is equal to all instances ofImmutableRoleOptionsthat have equal attribute values.inthashCode()Computes a hash code from attributes:toQueryParameters,toHeaders,policy,namespace.com.google.common.collect.ImmutableList<String>toString()Prints the immutable valueRoleOptionswith attribute values.final ImmutableRoleOptionswithNamespace(String value) Copy the current immutable object by setting a present value for the optionalnamespaceattribute.final ImmutableRoleOptionswithNamespace(Optional<String> optional) Copy the current immutable object by setting an optional value for thenamespaceattribute.final ImmutableRoleOptionswithPolicy(String value) Copy the current immutable object by setting a present value for the optionalpolicyattribute.final ImmutableRoleOptionswithPolicy(Optional<String> optional) Copy the current immutable object by setting an optional value for thepolicyattribute.final ImmutableRoleOptionswithToHeaders(Map<String, ? extends String> entries) Copy the current immutable object by replacing thetoHeadersmap with the specified map.final ImmutableRoleOptionswithToQueryParameters(Iterable<String> elements) Copy the current immutable object with elements that replace the content oftoQueryParameters.final ImmutableRoleOptionswithToQueryParameters(String... elements) Copy the current immutable object with elements that replace the content oftoQueryParameters.Methods inherited from class org.kiwiproject.consul.option.RoleOptions
toQuery
-
Method Details
-
toQueryParameters
- Returns:
- The value of the
toQueryParametersattribute
-
toHeaders
- Returns:
- The value of the
toHeadersattribute
-
getPolicy
- Specified by:
getPolicyin classRoleOptions- Returns:
- The value of the
policyattribute
-
getNamespace
- Specified by:
getNamespacein classRoleOptions- Returns:
- The value of the
namespaceattribute
-
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
-
withPolicy
Copy the current immutable object by setting a present value for the optionalpolicyattribute.- Parameters:
value- The value for policy- Returns:
- A modified copy of
thisobject
-
withPolicy
Copy the current immutable object by setting an optional value for thepolicyattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for policy- Returns:
- A modified copy of
thisobject
-
withNamespace
Copy the current immutable object by setting a present value for the optionalnamespaceattribute.- Parameters:
value- The value for namespace- Returns:
- A modified copy of
thisobject
-
withNamespace
Copy the current immutable object by setting an optional value for thenamespaceattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for namespace- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableRoleOptionsthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:toQueryParameters,toHeaders,policy,namespace. -
toString
Prints the immutable valueRoleOptionswith attribute values. -
copyOf
Creates an immutable copy of aRoleOptionsvalue. 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 RoleOptions instance
-
builder
Creates a builder forImmutableRoleOptions.ImmutableRoleOptions.builder() .addToQueryParameters|addAllToQueryParameters(String) //toQueryParameterselements .putToHeaders|putAllToHeaders(String => String) //toHeadersmappings .policy(String) // optionalpolicy.namespace(String) // optionalnamespace.build();- Returns:
- A new ImmutableRoleOptions builder
-