Class NodeBuilder

java.lang.Object
io.atomix.cluster.NodeBuilder
All Implemented Interfaces:
io.atomix.utils.Builder<Node>
Direct Known Subclasses:
MemberBuilder

public class NodeBuilder
extends Object
implements io.atomix.utils.Builder<Node>
Node builder.
  • Method Details

    • withId

      public NodeBuilder withId​(String id)
      Sets the node identifier.
      Parameters:
      id - the node identifier
      Returns:
      the node builder
    • withId

      public NodeBuilder withId​(NodeId id)
      Sets the node identifier.
      Parameters:
      id - the node identifier
      Returns:
      the node builder
    • withHost

      public NodeBuilder withHost​(String host)
      Sets the node host.
      Parameters:
      host - the node host
      Returns:
      the node builder
    • withPort

      public NodeBuilder withPort​(int port)
      Sets the node port.
      Parameters:
      port - the node port
      Returns:
      the node builder
    • withAddress

      @Deprecated public NodeBuilder withAddress​(String address)
      Deprecated.
      since 3.1. Use withHost(String) and/or withPort(int) instead
      Sets the node address.
      Parameters:
      address - a host:port tuple
      Returns:
      the node builder
      Throws:
      io.atomix.utils.net.MalformedAddressException - if a valid Address cannot be constructed from the arguments
    • withAddress

      @Deprecated public NodeBuilder withAddress​(String host, int port)
      Deprecated.
      since 3.1. Use withHost(String) and withPort(int) instead
      Sets the node host/port.
      Parameters:
      host - the host name
      port - the port number
      Returns:
      the node builder
      Throws:
      io.atomix.utils.net.MalformedAddressException - if a valid Address cannot be constructed from the arguments
    • withAddress

      @Deprecated public NodeBuilder withAddress​(int port)
      Deprecated.
      since 3.1. Use withPort(int) instead
      Sets the node address using local host.
      Parameters:
      port - the port number
      Returns:
      the node builder
      Throws:
      io.atomix.utils.net.MalformedAddressException - if a valid Address cannot be constructed from the arguments
    • withAddress

      public NodeBuilder withAddress​(io.atomix.utils.net.Address address)
      Sets the node address.
      Parameters:
      address - the node address
      Returns:
      the node builder
    • build

      public Node build()
      Specified by:
      build in interface io.atomix.utils.Builder<Node>