@InterfaceAudience.Public @InterfaceStability.Evolving public class IPUtils extends Object
IpSubnetCheck| Constructor and Description |
|---|
IPUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getIpAsInt(InetAddress host)
Gets the IpAddress as 32 bit signed integer.
|
static int |
getIpAsInt(IpFeilds feilds)
Gets the IpAddress as 32 bit signed integer.
|
static long |
getIpAsLong(InetAddress host)
Gets the IpAddress as long.
|
static long |
getIpAsLong(IpFeilds feilds)
Gets the IpAddress as long.
|
static List<String> |
getIpsInRange(InetAddress begin,
InetAddress end)
Gets all the IPs in the given range including the begin and end IP
Addresses.
|
static InetAddress |
getLongAsIP(long longIp)
Gets the long as ip.
|
static String |
getLongAsIPString(long longIp)
Gets the long as ip string.
|
static boolean |
isItInRange(InetAddress begin,
InetAddress end,
InetAddress check)
Checks if is it in the given range.
|
static boolean |
isItInRange(IpFeilds begin,
IpFeilds end,
IpFeilds check)
Checks if is it in range.
|
public static boolean isItInRange(InetAddress begin, InetAddress end, InetAddress check)
begin - the beginend - the endcheck - the checkpublic static boolean isItInRange(IpFeilds begin, IpFeilds end, IpFeilds check)
begin - the beginend - the endcheck - the checkpublic static int getIpAsInt(InetAddress host)
host - the hostpublic static int getIpAsInt(IpFeilds feilds)
feilds - the feildspublic static long getIpAsLong(InetAddress host)
host - the hostpublic static long getIpAsLong(IpFeilds feilds)
feilds - the feildspublic static List<String> getIpsInRange(InetAddress begin, InetAddress end)
begin - the beginend - the endpublic static InetAddress getLongAsIP(long longIp) throws UnknownHostException
longIp - the long ipUnknownHostException - the unknown host exceptionpublic static String getLongAsIPString(long longIp)
longIp - the long ipCopyright © 2016 utils4j. All Rights Reserved.