/** * Creates a new instance. * * @param host the IP address or host name of the ZooKeeper server * @param quorumPort the quorum port number * @param electionPort the election port number * @param clientPort the client port number (0-65535) */ @JsonCreator public ZooKeeperAddress(@JsonProperty(value = "host", required = true) String host, @JsonProperty(value = "quorumPort", required = true) int quorumPort, @JsonProperty(value = "electionPort", required = true) int electionPort, @JsonProperty(value = "clientPort", defaultValue = "0") int clientPort) { this.host = requireNonNull(host, "host"); this.quorumPort = validatePort(quorumPort, "quorumPort"); this.electionPort = validatePort(electionPort, "electionPort"); checkArgument(clientPort >= 0 && clientPort <= 65535, "clientPort: %s (expected: 0-65535)", clientPort); this.clientPort = clientPort; }
/** * Creates a new instance. * * @param host the IP address or host name of the ZooKeeper server * @param quorumPort the quorum port number * @param electionPort the election port number * @param clientPort the client port number (0-65535) */ @JsonCreator public ZooKeeperAddress(@JsonProperty(value = "host", required = true) String host, @JsonProperty(value = "quorumPort", required = true) int quorumPort, @JsonProperty(value = "electionPort", required = true) int electionPort, @JsonProperty(value = "clientPort", defaultValue = "0") int clientPort) { this.host = requireNonNull(host, "host"); this.quorumPort = validatePort(quorumPort, "quorumPort"); this.electionPort = validatePort(electionPort, "electionPort"); checkArgument(clientPort >= 0 && clientPort <= 65535, "clientPort: %s (expected: 0-65535)", clientPort); this.clientPort = clientPort; }
/** * Creates a new instance. * * @param host the IP address or host name of the ZooKeeper server * @param quorumPort the quorum port number * @param electionPort the election port number * @param clientPort the client port number (0-65535) */ @JsonCreator public ZooKeeperAddress(@JsonProperty(value = "host", required = true) String host, @JsonProperty(value = "quorumPort", required = true) int quorumPort, @JsonProperty(value = "electionPort", required = true) int electionPort, @JsonProperty(value = "clientPort", defaultValue = "0") int clientPort) { this.host = requireNonNull(host, "host"); this.quorumPort = validatePort(quorumPort, "quorumPort"); this.electionPort = validatePort(electionPort, "electionPort"); checkArgument(clientPort >= 0 && clientPort <= 65535, "clientPort: %s (expected: 0-65535)", clientPort); this.clientPort = clientPort; }