Class ImmutableRaftServer


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

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

    • Method Detail

      • id

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

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

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

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

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

        public final ImmutableRaftServer withId​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableRaftServer 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: id, node, address, leader, voter.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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