public class PatternRule extends Object implements IpFilterRule, Comparable<Object>
Rule ::= [n|i]:address n stands for computer name, i for ip address address ::= <regex> | localhost regex is a regular expression with '*' as multi character and '?' as single character wild card
Constructor and Description |
---|
PatternRule(boolean allow,
String pattern)
Instantiates a new pattern rule.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o) |
boolean |
contains(InetAddress inetAddress)
Compares the given InetAddress against the IpSet and returns true if
the InetAddress is contained in this Rule and false if not.
|
String |
getPattern()
returns the pattern.
|
boolean |
isAllowRule() |
boolean |
isDenyRule() |
public PatternRule(boolean allow, String pattern)
allow
- indicates if this is an allow or block rulepattern
- the filter patternpublic String getPattern()
public boolean isAllowRule()
isAllowRule
in interface IpFilterRule
public boolean isDenyRule()
isDenyRule
in interface IpFilterRule
public boolean contains(InetAddress inetAddress)
IpSet
public int compareTo(Object o)
compareTo
in interface Comparable<Object>
Copyright © 2008-2015 The Netty Project. All Rights Reserved.