code: public String portsAsString() {
      final StringBuilder sb = new StringBuilder();
      if (ports() != null) {
        for (final PortMapping port : ports()) {
          if (sb.length() > 0) {
            sb.append(", ");
          }
          if (port.ip() != null) {
            sb.append(port.ip()).append(":");
          }
          if (port.publicPort() > 0) {
            sb.append(port.privatePort()).append("->").append(port.publicPort());
          } else {
            sb.append(port.privatePort());
          }
          sb.append("/").append(port.type());
        }
      }
  
      return sb.toString();
    }
docs: Returns port information the way that <code>docker ps</code> does.
  <code>0.0.0.0:5432-&gt;5432/tcp</code> or <code>6379/tcp</code>.
  
  <p>It should not be used to extract detailed information of ports. To do so, please refer to
  {@link com.spotify.docker.client.messages.PortBinding}.
  
  @return port information as docker ps does.
  @see com.spotify.docker.client.messages.PortBinding