Package com.orbitz.consul.model.operator
Class ImmutableRaftConfiguration
- java.lang.Object
-
- com.orbitz.consul.model.operator.RaftConfiguration
-
- com.orbitz.consul.model.operator.ImmutableRaftConfiguration
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableRaftConfiguration extends RaftConfigurationImmutable implementation ofRaftConfiguration.Use the builder to create immutable instances:
ImmutableRaftConfiguration.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableRaftConfiguration.BuilderBuilds instances of typeImmutableRaftConfiguration.
-
Method Summary
Modifier and Type Method Description static ImmutableRaftConfiguration.Builderbuilder()Creates a builder forImmutableRaftConfiguration.static ImmutableRaftConfigurationcopyOf(RaftConfiguration instance)Creates an immutable copy of aRaftConfigurationvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableRaftConfigurationthat have equal attribute values.inthashCode()Computes a hash code from attributes:servers,index.java.math.BigIntegerindex()com.google.common.collect.ImmutableList<RaftServer>servers()java.lang.StringtoString()Prints the immutable valueRaftConfigurationwith attribute values.ImmutableRaftConfigurationwithIndex(java.math.BigInteger value)Copy the current immutable object by setting a value for theindexattribute.ImmutableRaftConfigurationwithServers(RaftServer... elements)Copy the current immutable object with elements that replace the content ofservers.ImmutableRaftConfigurationwithServers(java.lang.Iterable<? extends RaftServer> elements)Copy the current immutable object with elements that replace the content ofservers.
-
-
-
Method Detail
-
servers
public com.google.common.collect.ImmutableList<RaftServer> servers()
- Specified by:
serversin classRaftConfiguration- Returns:
- The value of the
serversattribute
-
index
public java.math.BigInteger index()
- Specified by:
indexin classRaftConfiguration- Returns:
- The value of the
indexattribute
-
withServers
public final ImmutableRaftConfiguration withServers(RaftServer... elements)
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
public final ImmutableRaftConfiguration withServers(java.lang.Iterable<? extends RaftServer> elements)
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
public final ImmutableRaftConfiguration withIndex(java.math.BigInteger value)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableRaftConfigurationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:servers,index.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueRaftConfigurationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableRaftConfiguration copyOf(RaftConfiguration instance)
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
public static ImmutableRaftConfiguration.Builder builder()
Creates a builder forImmutableRaftConfiguration.ImmutableRaftConfiguration.builder() .addServers|addAllServers(com.orbitz.consul.model.operator.RaftServer) //serverselements .index(java.math.BigInteger) // requiredindex.build();- Returns:
- A new ImmutableRaftConfiguration builder
-
-