public Builder setServerPort(final Integer serverPort) {
      if (serverPort == null) {
        this.serverPort = null;
        serverPortSetByUser = false;
        return this;
      }

      if (serverPort < 0 || serverPort > 65535) {
        throw new IllegalArgumentException(
            "The port on which the Server will listen must be between 1 and 65535 inclusive.");
      }

      if (serverPort == 0) {
        this.serverPort = 0;
        serverPortSetByUser = false;
      } else {
        this.serverPort = serverPort;
        serverPortSetByUser = true;
      }

      return this;
    }
Sets the port on which the Server will listen for and accept cache client connections in a
client/server topology.

@param serverPort an Integer value specifying the port the Server will listen on and accept
       cache client connections in a client/server topology.
@return this Builder instance.
@throws IllegalArgumentException if the port number is not valid.
@see #getServerPort()
geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java