public class InetAddressValidator extends Object implements Serializable
InetAddress validation and conversion routines (java.net.InetAddress).
This class provides methods to validate a candidate IP address.
This class is a Singleton; you can retrieve the instance via the getInstance() method.
| Constructor and Description |
|---|
InetAddressValidator() |
| Modifier and Type | Method and Description |
|---|---|
static InetAddressValidator |
getInstance()
Returns the singleton instance of this validator.
|
boolean |
isValid(String inetAddress)
Checks if the specified string is a valid IP address.
|
boolean |
isValidInet4Address(String inet4Address)
Validates an IPv4 address.
|
public static InetAddressValidator getInstance()
public boolean isValid(String inetAddress)
inetAddress - the string to validatepublic boolean isValidInet4Address(String inet4Address)
inet4Address - the IPv4 address to validateCopyright © 2014 OpenEstate. All rights reserved.