Package net.shibboleth.shared.logic

# Class RegexPredicate

java.lang.Object
net.shibboleth.shared.logic.RegexPredicate

All Implemented Interfaces:
  `Predicate<CharSequence>`

public class RegexPredicate extends Object implements Predicate<CharSequence>
A `Predicate` that checks that a given input string matches a regular expression. If a given input is `null` this predicate returns `false`.

Since:
  7.4.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Pattern`
`pattern`
Regular expression.

## Constructor Summary

Constructors
Constructor
Description
`RegexPredicate(String s)`
String constructor.
`RegexPredicate(Pattern p)`
Pattern constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`test(CharSequence input)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Predicate

`and, negate, or`

## Field Details

### pattern

@Nonnull private Pattern pattern
Regular expression.

## Constructor Details

### RegexPredicate

public RegexPredicate(@Nonnull Pattern p)
Pattern constructor.

Parameters:
  `p` - the pattern to match the input against

### RegexPredicate

public RegexPredicate(@Nonnull @NotEmpty String s)
String constructor.

Parameters:
  `s` - the pattern to match the input against

## Method Details

### test

public boolean test(CharSequence input)

Specified by:
  `test` in interface `Predicate<CharSequence>`