public class IPv4AddressWithMask extends IPAddressWithMask<IPv4Address>
Modifier and Type | Field and Description |
---|---|
static IPv4AddressWithMask |
NONE |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(IPAddress<?> ip) |
IPVersion |
getIpVersion() |
static IPv4AddressWithMask |
of(int rawValue,
int rawMask)
Deprecated.
replaced by
IPv4Address.of(int) and
IPv4Address.withMask(IPv4Address) , e.g.
IPv4Address.of(int).withMask(IPv4Address.of(int))
|
static IPv4AddressWithMask |
of(IPv4Address value,
IPv4Address mask)
Returns an
IPv4AddressWithMask object that represents the given
IP address masked by the given IP address mask. |
static IPv4AddressWithMask |
of(String string)
Returns an
IPv4AddressWithMask object that corresponds to
the given string in CIDR notation or other acceptable notations. |
getSubnetBroadcastAddress, isSubnetBroadcastAddress, toString
public static final IPv4AddressWithMask NONE
public IPVersion getIpVersion()
getIpVersion
in class IPAddressWithMask<IPv4Address>
@Nonnull @Deprecated public static IPv4AddressWithMask of(int rawValue, int rawMask)
IPv4Address.of(int)
and
IPv4Address.withMask(IPv4Address)
, e.g.
IPv4Address.of(int).withMask(IPv4Address.of(int))
IPv4AddressWithMask
object that represents the given
raw IP address masked by the given raw IP address mask.rawValue
- the raw IP address to be maskedrawMask
- the raw IP address maskIPv4AddressWithMask
object that represents
the given raw IP address masked by the given raw IP
address mask@Nonnull public static IPv4AddressWithMask of(@Nonnull IPv4Address value, @Nonnull IPv4Address mask)
IPv4AddressWithMask
object that represents the given
IP address masked by the given IP address mask. Both arguments are given
as IPv4Address
objects.value
- the IP address to be maskedmask
- the IP address maskIPv4AddressWithMask
object that represents
the given IP address masked by the given IP address maskNullPointerException
- if any of the given IPv4Address
objects were null
@Nonnull public static IPv4AddressWithMask of(@Nonnull String string)
IPv4AddressWithMask
object that corresponds to
the given string in CIDR notation or other acceptable notations.
The following notations are accepted.
Notation | Example | Notes |
---|---|---|
IPv4 address only | 1.2.3.4 | The subnet mask of
prefix length 32 (i.e. 255.255.255.255 ) is assumed. |
IPv4 address/mask | 1.2.3.4/255.255.255.0 |
|
CIDR notation | 1.2.3.4/24 |
string
- the string in acceptable notationsIPv4AddressWithMask
object that corresponds to
the given string in acceptable notationsNullPointerException
- if the given string was null
IllegalArgumentException
- if the given string was malformedpublic boolean contains(IPAddress<?> ip)
contains
in class IPAddressWithMask<IPv4Address>
Copyright © 2015. All rights reserved.