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

  • Method Details

    • servers

      public com.google.common.collect.ImmutableList<RaftServer> servers()
      Specified by:
      servers in class RaftConfiguration
      Returns:
      The value of the servers attribute
    • index

      public BigInteger index()
      Specified by:
      index in class RaftConfiguration
      Returns:
      The value of the index attribute
    • withServers

      public final ImmutableRaftConfiguration withServers(RaftServer... elements)
      Copy the current immutable object with elements that replace the content of servers.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withServers

      public final ImmutableRaftConfiguration withServers(Iterable<? extends RaftServer> elements)
      Copy the current immutable object with elements that replace the content of servers. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of servers elements to set
      Returns:
      A modified copy of this object
    • withIndex

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableRaftConfiguration 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: servers, index.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableRaftConfiguration copyOf(RaftConfiguration instance)
      Creates an immutable copy of a RaftConfiguration 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 RaftConfiguration instance
    • builder

      public static ImmutableRaftConfiguration.Builder builder()
      Creates a builder for ImmutableRaftConfiguration.
       ImmutableRaftConfiguration.builder()
          .addServers|addAllServers(org.kiwiproject.consul.model.operator.RaftServer) // servers elements
          .index(java.math.BigInteger) // required index
          .build();
       
      Returns:
      A new ImmutableRaftConfiguration builder