@ProviderType public class Rule extends Object implements JsonObjectConvertible
config options:
typeRuleType of the rule: include or exclude (or allow or deny). The
meaning of this value is usually dependent on context.pattern^] and end [$]
are assumed).| Modifier and Type | Class and Description |
|---|---|
static interface |
Rule.JsonKeys |
| Constructor and Description |
|---|
Rule(RuleType type,
Pattern pattern)
Create a new rule.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Pattern |
getPattern() |
RuleType |
getType() |
int |
hashCode() |
boolean |
isAllow()
Readability alias for
isInclude() when the rule is used in the more abstract context of scope
definition. |
boolean |
isDeny()
Readability alias for
isExclude() when the rule is used in the more literal context of acceptable vs
unacceptable values. |
boolean |
isExclude()
Readability alias for
isDeny() when the rule is used in the more abstract context of scope
definition. |
boolean |
isInclude()
Readability alias for
isAllow() when the rule is used in the more abstract context of scope
definition. |
static @NotNull Rule.JsonKeys |
keys() |
boolean |
matches(String value)
Conventional usage of the rule's
Pattern to match the entirety of the provided string value. |
javax.json.JsonObject |
toJson()
Serializes the rule to a
JsonObject. |
String |
toString() |
public Rule(RuleType type, Pattern pattern)
type - RuleType.INCLUDE or RuleType.EXCLUDE
(or RuleType.ALLOW or RuleType.DENY)pattern - a compiled regular expression pattern@NotNull public static @NotNull Rule.JsonKeys keys()
public RuleType getType()
public Pattern getPattern()
public boolean isInclude()
isAllow() when the rule is used in the more abstract context of scope
definition.public boolean isExclude()
isDeny() when the rule is used in the more abstract context of scope
definition.public boolean isAllow()
isInclude() when the rule is used in the more abstract context of scope
definition.public boolean isDeny()
isExclude() when the rule is used in the more literal context of acceptable vs
unacceptable values.public boolean matches(String value)
Pattern to match the entirety of the provided string value. The nature
of the value is not considered.value - a string valuepublic javax.json.JsonObject toJson()
JsonObject.toJson in interface JsonObjectConvertibleCopyright © 2017–2020. All rights reserved.