package io.scalecube.services.api;

import java.util.Objects;

public class Address {
  private final String host;
  private final int port;

  public static Address create(String host, int port) {
    return new Address(host, port);
  }

  private Address(String host, int port) {
    this.host = host;
    this.port = port;
  }

  public String host() {
    return this.host;
  }

  public int port() {
    return this.port;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Address address = (Address) o;
    return port == address.port && Objects.equals(host, address.host);
  }

  @Override
  public int hashCode() {
    return Objects.hash(host, port);
  }

  @Override
  public String toString() {
    return this.host + ":" + this.port;
  }
}

@@ -79,16 +79,17 @@
 dress %7B%0A
+%0A
   privat
@@ -143,119 +143,413 @@
 %0A  p
-ublic static Address create(String host, int port) %7B%0A    return new Address(host, port);%0A  %7D%0A%0A  private
+rivate Address(String host, int port) %7B%0A    this.host = host;%0A    this.port = port;%0A  %7D%0A%0A  /**%0A   * Create address.%0A   *%0A   * @param host host%0A   * @param port port%0A   * @return address%0A   */%0A  public static Address create(String host, int port) %7B%0A    return new Address(host, port);%0A  %7D%0A%0A  /**%0A   * Create address.%0A   *%0A   * @param hostAndPort host:port%0A   * @return address%0A   */%0A  public static
  Address
 (Str
@@ -536,32 +536,37 @@
 c static Address
+ from
 (String host, in
@@ -565,64 +565,248 @@
 host
-, int port) %7B%0A    this.host = host
+AndPort) %7B%0A    String%5B%5D split = hostAndPort.split(%22:%22);%0A    if (split.length != 2) %7B%0A      throw new IllegalArgumentException();%0A    %7D%0A    String host = split%5B0%5D
 ;%0A    
-this.
+int 
 port =
+ Integer.parseInt(split%5B1%5D);%0A    return new Address(host,
  port
+)
 ;%0A  

Set convenient .from method in address