Package org.forgerock.opendj.ldap
Class AddressMask
- java.lang.Object
-
- org.forgerock.opendj.ldap.AddressMask
-
public final class AddressMask extends Object
An address mask can be used to perform efficient comparisons against IP addresses to determine whether a particular IP address is in a given range.
-
-
Constructor Summary
Constructors Constructor Description AddressMask(org.forgerock.opendj.ldap.AddressMask.RuleType ruleType, String ruleString, byte[] ruleMask, byte[] prefixMask)
AddressMask(org.forgerock.opendj.ldap.AddressMask.RuleType ruleType, String ruleString, byte[] ruleMask, byte[] prefixMask, String[] hostName, String hostPattern, BitSet wildCard)
AddressMask(org.forgerock.opendj.ldap.AddressMask.RuleType ruleType, String ruleString, String[] hostName, String hostPattern, BitSet wildCard)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(InetAddress address)
Returnstrue
if this address mask matches the provided address.static boolean
matchesAny(Collection<AddressMask> masks, InetAddress address)
Returnstrue
if an address matches any of the provided address masks.String
toString()
static AddressMask
valueOf(String mask)
Parses the provided string as an address mask.
-
-
-
Constructor Detail
-
AddressMask
public AddressMask(org.forgerock.opendj.ldap.AddressMask.RuleType ruleType, String ruleString, byte[] ruleMask, byte[] prefixMask)
-
AddressMask
public AddressMask(org.forgerock.opendj.ldap.AddressMask.RuleType ruleType, String ruleString, String[] hostName, String hostPattern, BitSet wildCard)
-
-
Method Detail
-
matchesAny
public static boolean matchesAny(Collection<AddressMask> masks, InetAddress address)
Returnstrue
if an address matches any of the provided address masks.- Parameters:
address
- The address.masks
- A collection of address masks to check.- Returns:
true
if an address matches any of the provided address masks.
-
valueOf
public static AddressMask valueOf(String mask)
Parses the provided string as an address mask.- Parameters:
mask
- The address mask string to be parsed.- Returns:
- The parsed address mask.
- Throws:
LocalizedIllegalArgumentException
- If the provided string cannot be decoded as an address mask.
-
matches
public boolean matches(InetAddress address)
Returnstrue
if this address mask matches the provided address.- Parameters:
address
- The address.- Returns:
true
if this address mask matches the provided address.
-
-