Class ImmutableWriteRequest
java.lang.Object
org.kiwiproject.consul.model.catalog.WriteRequest
org.kiwiproject.consul.model.catalog.ImmutableWriteRequest
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableWriteRequest
extends WriteRequest
Immutable implementation of
WriteRequest.
Use the builder to create immutable instances:
ImmutableWriteRequest.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableWriteRequest. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableWriteRequest.static ImmutableWriteRequestcopyOf(WriteRequest instance) Creates an immutable copy of aWriteRequestvalue.booleanThis instance is equal to all instances ofImmutableWriteRequestthat have equal attribute values.inthashCode()Computes a hash code from attributes:token.token()toString()Prints the immutable valueWriteRequestwith attribute values.final ImmutableWriteRequestCopy the current immutable object by setting a value for thetokenattribute.
-
Method Details
-
token
- Specified by:
tokenin classWriteRequest- Returns:
- The value of the
tokenattribute
-
withToken
Copy the current immutable object by setting a value for thetokenattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for token- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableWriteRequestthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:token. -
toString
Prints the immutable valueWriteRequestwith attribute values. -
copyOf
Creates an immutable copy of aWriteRequestvalue. 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 WriteRequest instance
-
builder
Creates a builder forImmutableWriteRequest.ImmutableWriteRequest.builder() .token(String) // requiredtoken.build();- Returns:
- A new ImmutableWriteRequest builder
-