public final class SubnetUtils.SubnetInfo extends Object
Modifier and Type | Method and Description |
---|---|
int |
asInteger(String address) |
String |
getAddress() |
int |
getAddressCount()
Deprecated.
(3.4) use
getAddressCountLong() instead |
long |
getAddressCountLong()
Gets the count of available addresses.
|
String[] |
getAllAddresses() |
String |
getBroadcastAddress() |
String |
getCidrSignature() |
String |
getHighAddress()
Gets the high address as a dotted IP address.
|
String |
getLowAddress()
Gets the low address as a dotted IP address.
|
String |
getNetmask() |
String |
getNetworkAddress() |
String |
getNextAddress() |
String |
getPreviousAddress() |
boolean |
isInRange(int address)
Tests if the parameter
address is in the range of usable endpoint addresses for this subnet. |
boolean |
isInRange(String address)
Tests if the parameter
address is in the range of usable endpoint addresses for this subnet. |
String |
toString() |
public String getAddress()
@Deprecated public int getAddressCount()
getAddressCountLong()
insteadRuntimeException
- if the correct count is greater than Integer.MAX_VALUE
public long getAddressCountLong()
public String[] getAllAddresses()
public String getBroadcastAddress()
public String getCidrSignature()
public String getHighAddress()
public String getLowAddress()
public String getNetmask()
public String getNetworkAddress()
public String getNextAddress()
public String getPreviousAddress()
public boolean isInRange(int address)
address
is in the range of usable endpoint addresses for this subnet. This excludes the network and broadcast
addresses by default. Use SubnetUtils.setInclusiveHostCount(boolean)
to change this.address
- the address to checkpublic boolean isInRange(String address)
address
is in the range of usable endpoint addresses for this subnet. This excludes the network and broadcast
addresses. Use SubnetUtils.setInclusiveHostCount(boolean)
to change this.address
- A dot-delimited IPv4 address, e.g. "192.168.0.1"Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.