## org.mariadb.jdbc
Class HostAddress

    java.lang.Object
      org.mariadb.jdbc.HostAddress

    public class HostAddress

extends Object

Field Summary
`String` `host`
`int` `port`
`String` `type`

Constructor Summary
`HostAddress()`
`HostAddress(String host, int port)` Constructor. type is master.
`HostAddress(String host, int port, String type)` Constructor.

Method Summary
`boolean` `equals(Object obj)`
`int` `hashCode()`
`static List<HostAddress>` `parse(String spec, HaMode haMode)` parse - parse server addresses from the URL fragment
`String` `toString()`
`static String` `toString(HostAddress[] addrs)` ToString implementation of addresses.
`static String` `toString(List<HostAddress> addrs)` ToString implementation of addresses.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### host

    public String host

### port

    public int port

### type

    public String type

Constructor Detail

### HostAddress

    public HostAddress()

### HostAddress

    public HostAddress(String host,
                       int port)

  Constructor. type is master.

  Parameters:
    `host` - host
    `port` - port

### HostAddress

    public HostAddress(String host,
                       int port,
                       String type)

  Constructor.

  Parameters:
    `host` - host
    `port` - port
    `type` - type

Method Detail

### parse

    public static List<HostAddress> parse(String spec,
                                          HaMode haMode)

  parse - parse server addresses from the URL fragment

  Parameters:
    `spec` - - list of endpoints in one of the forms 1 - host1,....,hostN:port (missing port default to MySQL default 3306 2 - host:port,...,host:port
    `haMode` - High availability mode
  Returns:
    parsed endpoints

### toString

    public static String toString(List<HostAddress> addrs)

  ToString implementation of addresses.

  Parameters:
    `addrs` - address list
  Returns:
    String value

### toString

    public static String toString(HostAddress[] addrs)

  ToString implementation of addresses.

  Parameters:
    `addrs` - address array
  Returns:
    String value

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

Copyright © 2017. All rights reserved.