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().

  • Method Details

    • id

      public String id()
      Specified by:
      id in class RaftServer
      Returns:
      The value of the id attribute
    • node

      public String node()
      Specified by:
      node in class RaftServer
      Returns:
      The value of the node attribute
    • address

      public String address()
      Specified by:
      address in class RaftServer
      Returns:
      The value of the address attribute
    • leader

      public Boolean leader()
      Specified by:
      leader in class RaftServer
      Returns:
      The value of the leader attribute
    • voter

      public Boolean voter()
      Specified by:
      voter in class RaftServer
      Returns:
      The value of the voter attribute
    • withId

      public final ImmutableRaftServer withId(String value)
      Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy of the this object
    • withNode

      public final ImmutableRaftServer withNode(String value)
      Copy the current immutable object by setting a value for the node attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for node
      Returns:
      A modified copy of the this object
    • withAddress

      public final ImmutableRaftServer withAddress(String value)
      Copy the current immutable object by setting a value for the address attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for address
      Returns:
      A modified copy of the this object
    • withLeader

      public final ImmutableRaftServer withLeader(Boolean value)
      Copy the current immutable object by setting a value for the leader attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for leader
      Returns:
      A modified copy of the this object
    • withVoter

      public final ImmutableRaftServer withVoter(Boolean value)
      Copy the current immutable object by setting a value for the voter attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for voter
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableRaftServer that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: id, node, address, leader, voter.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value RaftServer with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableRaftServer copyOf(RaftServer instance)
      Creates an immutable copy of a RaftServer value. 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

      public static ImmutableRaftServer.Builder builder()
      Creates a builder for ImmutableRaftServer.
       ImmutableRaftServer.builder()
          .id(String) // required id
          .node(String) // required node
          .address(String) // required address
          .leader(Boolean) // required leader
          .voter(Boolean) // required voter
          .build();
       
      Returns:
      A new ImmutableRaftServer builder