Class ImmutableRaftServer
java.lang.Object
org.kiwiproject.consul.model.operator.RaftServer
org.kiwiproject.consul.model.operator.ImmutableRaftServer
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableRaftServer
extends RaftServer
Immutable implementation of
RaftServer.
Use the builder to create immutable instances:
ImmutableRaftServer.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableRaftServer. -
Method Summary
Modifier and TypeMethodDescriptionaddress()static ImmutableRaftServer.Builderbuilder()Creates a builder forImmutableRaftServer.static ImmutableRaftServercopyOf(RaftServer instance) Creates an immutable copy of aRaftServervalue.booleanThis instance is equal to all instances ofImmutableRaftServerthat have equal attribute values.inthashCode()Computes a hash code from attributes:id,node,address,leader,voter.id()leader()node()toString()Prints the immutable valueRaftServerwith attribute values.voter()final ImmutableRaftServerwithAddress(String value) Copy the current immutable object by setting a value for theaddressattribute.final ImmutableRaftServerCopy the current immutable object by setting a value for theidattribute.final ImmutableRaftServerwithLeader(Boolean value) Copy the current immutable object by setting a value for theleaderattribute.final ImmutableRaftServerCopy the current immutable object by setting a value for thenodeattribute.final ImmutableRaftServerCopy the current immutable object by setting a value for thevoterattribute.
-
Method Details
-
id
- Specified by:
idin classRaftServer- Returns:
- The value of the
idattribute
-
node
- Specified by:
nodein classRaftServer- Returns:
- The value of the
nodeattribute
-
address
- Specified by:
addressin classRaftServer- Returns:
- The value of the
addressattribute
-
leader
- Specified by:
leaderin classRaftServer- Returns:
- The value of the
leaderattribute
-
voter
- Specified by:
voterin classRaftServer- Returns:
- The value of the
voterattribute
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withNode
Copy the current immutable object by setting a value for thenodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for node- Returns:
- A modified copy of the
thisobject
-
withAddress
Copy the current immutable object by setting a value for theaddressattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for address- Returns:
- A modified copy of the
thisobject
-
withLeader
Copy the current immutable object by setting a value for theleaderattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for leader- Returns:
- A modified copy of the
thisobject
-
withVoter
Copy the current immutable object by setting a value for thevoterattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for voter- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableRaftServerthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,node,address,leader,voter. -
toString
Prints the immutable valueRaftServerwith attribute values. -
copyOf
Creates an immutable copy of aRaftServervalue. 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 RaftServer instance
-
builder
Creates a builder forImmutableRaftServer.ImmutableRaftServer.builder() .id(String) // requiredid.node(String) // requirednode.address(String) // requiredaddress.leader(Boolean) // requiredleader.voter(Boolean) // requiredvoter.build();- Returns:
- A new ImmutableRaftServer builder
-