object IPAddress
Companion object to IPAddress
class.
- Alphabetic
- By Inheritance
- IPAddress
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
Localhost: IPAddress
Singleton
IPAddress
for the local loop address. -
def
allForName(hostname: String): Try[List[IPAddress]]
Get a list of all
IPAddress
objects for a given host name, based on whatever name service is configured for the running system.Get a list of all
IPAddress
objects for a given host name, based on whatever name service is configured for the running system.The host name can either be a machine name, such as "www.clapper.org", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked.
If the host is null, then this method return an
IPAddress
representing an address of the loopback interfaced. See RFC 3330 section 2 and RFC 2373 section 2.5.3.This method corresponds to the
getAllByName()
method in thejava.net.InetAddress
class.- hostname
the host name
- returns
a
Success
containing the list of resolved IP addresses, orFailure(exception)
on error.
- Annotations
- @SuppressWarnings()
-
def
apply(address: BigInt): Try[IPAddress]
Create an
IPAddress
from a number.Create an
IPAddress
from a number.- address
the numeric IP address
- returns
the
IPAddress
in aSuccess
, orFailure(exception)
on error.
-
def
apply(host: String): Try[IPAddress]
Create an
IPAddress
, given a host name.Create an
IPAddress
, given a host name. Note that this function may do a DNS lookup if the host name is not an address string. To parse _just_ an address string, ignoring host names, useparseAddress()
.- host
the host name or address string
- returns
the
IPAddress
in aSuccess
, orFailure(exception)
on error.
-
def
apply(inetAddress: InetAddress): IPAddress
Create an
IPAddress
from ajava.net.InetAddress
.Create an
IPAddress
from ajava.net.InetAddress
. You can also use the implicit conversions ingrizzled.net.Implicits
.- inetAddress
the
InetAddress
- returns
the
IPAddress
-
def
apply(address: List[Byte]): Try[IPAddress]
Create an
IPAddress
, given a list of bytes representing the addressCreate an
IPAddress
, given a list of bytes representing the address- If the array has fewer than four values, it is assumed to be an IPv4 address, and it will be padded with 0s to 4 bytes. - If the array has between four and 16 values, it is assumed to be an IPv6 address, and it will be padded with 0s to 16 bytes. - Anything else will cause an
IllegalArgumentException
to be thrown. Example of use:val ip = IPAddress(List(192, 168, 1, 100))
- address
the list of address values
- returns
the
IPAddress
in aSuccess
, orFailure(exception)
on error.
-
def
apply(addr: Int*): Try[IPAddress]
Create an
IPAddress
, given 1 to 16 integer arguments.Create an
IPAddress
, given 1 to 16 integer arguments. The integers will be truncated to 8-bit bytes.- If the array has fewer than four values, it is assumed to be an IPv4 address, and it will be padded with 0s to 4 bytes. - If the array has between four and 16 values, it is assumed to be an IPv6 address, and it will be padded with 0s to 16 bytes. - Anything else will cause an
IllegalArgumentException
to be thrown.Example of use:
val ip = IPAddress(Array(192, 168, 1, 100))
- addr
the bytes (as integers) of the address
- returns
the
IPAddress
in aSuccess
, orFailure(exception)
on error.
-
def
apply(addr: Array[Int]): Try[IPAddress]
Create an
IPAddress
, given an array of integers representing the address.Create an
IPAddress
, given an array of integers representing the address. The array must contain between 1 and 16 integer values. The integers will be truncated to 8-bit bytes.- If the array has fewer than four values, it is assumed to be an IPv4 address, and it will be padded with 0s to 4 bytes. - If the array has between four and 16 values, it is assumed to be an IPv6 address, and it will be padded with 0s to 16 bytes. - Anything else will cause an
IllegalArgumentException
to be thrown.Example of use:
val ip = IPAddress(Array(192, 168, 1, 100))
- addr
the address
- returns
the
IPAddress
in aSuccess
, orFailure(exception)
on error.
-
def
apply(addr: Array[Byte]): Try[IPAddress]
Create an
IPAddress
, given an array of bytes representing the address.Create an
IPAddress
, given an array of bytes representing the address. The array must contain between 1 and 16 byte values.- If the array has fewer than four values, it is assumed to be an IPv4 address, and it will be padded with 0s to 4 bytes. - If the array has between four and 16 values, it is assumed to be an IPv6 address, and it will be padded with 0s to 16 bytes. - Anything else will cause an
IllegalArgumentException
to be thrown.- addr
the address
- returns
the
IPAddress
in aSuccess
, orFailure(exception)
on error.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
parseAddress(addressString: String): Try[IPAddress]
Parse an address string (IPv4 or IPv6) only.
Parse an address string (IPv4 or IPv6) only. Host names will result in an error return value. NOTE: This function strips any IPv6 interface names, if they exist. That is, an address such as "fe80::cab3:73ff:fe19:c600%en5" is parsed as "fe80::cab3:73ff:fe19:c600".
- addressString
The address string
- returns
the
IPAddress
in aSuccess
, orFailure(exception)
on error.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )