org.apache.ignite.internal.util

## Class HostAndPortRange

- java.lang.Object
- - org.apache.ignite.internal.util.HostAndPortRange

All Implemented Interfaces:
  Serializable

    public class HostAndPortRange
    extends Object
    implements Serializable

Represents address along with port range.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`HostAndPortRange(String host, int port)` Constructor.
`HostAndPortRange(String host, int portFrom, int portTo)` Constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`int` `hashCode()`
`String` `host()`
`static HostAndPortRange` `parse(String addrStr, int dfltPortFrom, int dfltPortTo, String errMsgPrefix)` Parse string into host and port pair.
`int` `portFrom()`
`int` `portTo()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### HostAndPortRange

    public HostAndPortRange(String host,
                            int port)

Constructor.

Parameters:
  `host` - Host.
  `port` - Port.

#### HostAndPortRange

    public HostAndPortRange(String host,
                            int portFrom,
                            int portTo)

Constructor.

Parameters:
  `host` - Host.
  `portFrom` - Port from.
  `portTo` - Port to.

### Method Detail

#### parse

    public static HostAndPortRange parse(String addrStr,
                                         int dfltPortFrom,
                                         int dfltPortTo,
                                         String errMsgPrefix)
                                  throws IgniteCheckedException

Parse string into host and port pair.

Parameters:
  `addrStr` - String.
  `dfltPortFrom` - Default port from.
  `dfltPortTo` - Default port to.
  `errMsgPrefix` - Error message prefix.
Returns:
  Result.
Throws:
  `IgniteCheckedException` - If failed.

#### host

    public String host()

Returns:
  Host.

#### portFrom

    public int portFrom()

Returns:
  Port from.

#### portTo

    public int portTo()

Returns:
  Port to.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019