public final class InetAddressPredicates extends Object
Predicate of an
InetAddress.| Modifier and Type | Method and Description |
|---|---|
static Predicate<InetAddress> |
ofCidr(InetAddress baseAddress,
int maskBits)
Returns a
Predicate which returns true if the given InetAddress is in the
range of a Classless Inter-domain Routing (CIDR) block. |
static Predicate<InetAddress> |
ofCidr(InetAddress baseAddress,
String subnetMask)
Returns a
Predicate which returns true if the given InetAddress is in the
range of a Classless Inter-domain Routing (CIDR) block. |
static Predicate<InetAddress> |
ofCidr(String cidr)
Returns a
Predicate which returns true if the given InetAddress is in the
range of a Classless Inter-domain Routing (CIDR) block. |
static Predicate<InetAddress> |
ofExact(InetAddress address)
|
static Predicate<InetAddress> |
ofExact(String address)
|
public static Predicate<InetAddress> ofExact(InetAddress address)
address - the expected InetAddresspublic static Predicate<InetAddress> ofExact(String address)
address - the expected IP address string, e.g. 10.0.0.1public static Predicate<InetAddress> ofCidr(InetAddress baseAddress, int maskBits)
Predicate which returns true if the given InetAddress is in the
range of a Classless Inter-domain Routing (CIDR) block.baseAddress - the base InetAddress of a CIDR notationmaskBits - the number of significant bits which describes its network portionpublic static Predicate<InetAddress> ofCidr(InetAddress baseAddress, String subnetMask)
Predicate which returns true if the given InetAddress is in the
range of a Classless Inter-domain Routing (CIDR) block.baseAddress - the base InetAddress of a CIDR notationsubnetMask - the subnet mask, e.g. 255.255.255.0public static Predicate<InetAddress> ofCidr(String cidr)
Predicate which returns true if the given InetAddress is in the
range of a Classless Inter-domain Routing (CIDR) block.cidr - the CIDR notation of an address block, e.g. 10.0.0.0/8, 192.168.1.0/24,
1080:0:0:0:8:800:200C:4100/120Copyright © 2020 LeanCloud. All rights reserved.