Class ImmutableRaftConfiguration
java.lang.Object
org.kiwiproject.consul.model.operator.RaftConfiguration
org.kiwiproject.consul.model.operator.ImmutableRaftConfiguration
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableRaftConfiguration
extends RaftConfiguration
Immutable implementation of
RaftConfiguration.
Use the builder to create immutable instances:
ImmutableRaftConfiguration.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableRaftConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableRaftConfiguration.static ImmutableRaftConfigurationcopyOf(RaftConfiguration instance) Creates an immutable copy of aRaftConfigurationvalue.booleanThis instance is equal to all instances ofImmutableRaftConfigurationthat have equal attribute values.inthashCode()Computes a hash code from attributes:servers,index.index()com.google.common.collect.ImmutableList<RaftServer>servers()toString()Prints the immutable valueRaftConfigurationwith attribute values.withIndex(BigInteger value) Copy the current immutable object by setting a value for theindexattribute.withServers(Iterable<? extends RaftServer> elements) Copy the current immutable object with elements that replace the content ofservers.withServers(RaftServer... elements) Copy the current immutable object with elements that replace the content ofservers.
-
Method Details
-
servers
- Specified by:
serversin classRaftConfiguration- Returns:
- The value of the
serversattribute
-
index
- Specified by:
indexin classRaftConfiguration- Returns:
- The value of the
indexattribute
-
withServers
Copy the current immutable object with elements that replace the content ofservers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withServers
Copy the current immutable object with elements that replace the content ofservers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of servers elements to set- Returns:
- A modified copy of
thisobject
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableRaftConfigurationthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:servers,index. -
toString
Prints the immutable valueRaftConfigurationwith attribute values. -
copyOf
Creates an immutable copy of aRaftConfigurationvalue. 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 RaftConfiguration instance
-
builder
Creates a builder forImmutableRaftConfiguration.ImmutableRaftConfiguration.builder() .addServers|addAllServers(org.kiwiproject.consul.model.operator.RaftServer) //serverselements .index(java.math.BigInteger) // requiredindex.build();- Returns:
- A new ImmutableRaftConfiguration builder
-