The goog.net.IpAddress Class

goog.net.IpAddress(address, version)

Abstract class defining an IP Address. Please use goog.net.IpAddress static methods or goog.net.Ipv4Address/Ipv6Address classes.

address {!goog.math.Integer}
The Ip Address.
version {number}
The version number (4, 6).

.equals(other)

other {!goog.net.IpAddress}
The other IP Address.
returns {boolean}
true if the IP Addresses are equal.

.fromString(address)

Parses an IP Address in a string. If the string is malformed, the function will simply return null instead of raising an exception.

address {string}
The IP Address.
returns {goog.net.IpAddress}
The IP Address or null.
@see
{goog.net.Ipv4Address}
@see
{goog.net.Ipv6Address}

.fromUriString(address)

Tries to parse a string represented as a host portion of an URI. See RFC 3986 for more details on IPv6 addresses inside URI. If the string is malformed, the function will simply return null instead of raising an exception.

address {string}
A RFC 3986 encoded IP address.
returns {goog.net.IpAddress}
The IP Address.
@see
{goog.net.Ipv4Address}
@see
{goog.net.Ipv6Address}

.getVersion()

returns {number}
The IP Address version.

.toInteger()

returns {goog.math.Integer}
The IP Address, as an Integer.

.toString()

returns {string}
The IP Address, as a string.

.toUriString()

returns {string}
The IP Address, as an URI string following RFC 3986.