Class ImmutableRaftConfiguration


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableRaftConfiguration
    extends RaftConfiguration
    Immutable implementation of RaftConfiguration.

    Use the builder to create immutable instances: ImmutableRaftConfiguration.builder().

    • Method Detail

      • servers

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

        public java.math.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​(java.lang.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​(java.math.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
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableRaftConfiguration that have equal attribute values.
        Overrides:
        equals in class java.lang.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 java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value RaftConfiguration with attribute values.
        Overrides:
        toString in class java.lang.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