@InterfaceStability.Evolving public class ResourcePatternFilter extends Object
ResourcePattern
.
The API for this class is still evolving and we may break compatibility in minor releases, if necessary.
Modifier and Type | Field and Description |
---|---|
static ResourcePatternFilter |
ANY
Matches any resource pattern.
|
Constructor and Description |
---|
ResourcePatternFilter(ResourceType resourceType,
String name,
PatternType patternType)
Create a filter using the supplied parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
findIndefiniteField() |
int |
hashCode() |
boolean |
isUnknown() |
boolean |
matches(ResourcePattern pattern) |
boolean |
matchesAtMostOne() |
String |
name() |
PatternType |
patternType() |
ResourceType |
resourceType() |
String |
toString() |
public static final ResourcePatternFilter ANY
public ResourcePatternFilter(ResourceType resourceType, String name, PatternType patternType)
resourceType
- non-null resource type.
If ResourceType.ANY
, the filter will ignore the resource type of the pattern.
If any other resource type, the filter will match only patterns with the same type.name
- resource name or null
.
If null
, the filter will ignore the name of resources.
If ResourcePattern.WILDCARD_RESOURCE
, will match only wildcard patterns.patternType
- non-null resource pattern type.
If PatternType.ANY
, the filter will match patterns regardless of pattern type.
If PatternType.MATCH
, the filter will match patterns that would match the supplied
name
, including a matching prefixed and wildcards patterns.
If any other resource pattern type, the filter will match only patterns with the same type.public boolean isUnknown()
true
if this filter has any UNKNOWN components.public ResourceType resourceType()
public String name()
public PatternType patternType()
public boolean matches(ResourcePattern pattern)
true
if this filter matches the given pattern.public boolean matchesAtMostOne()
true
if this filter could only match one pattern.
In other words, if there are no ANY or UNKNOWN fields.public String findIndefiniteField()