Package org.opensaml.profile.logic

# Class IPRangePredicate

java.lang.Object
org.opensaml.profile.logic.IPRangePredicate

All Implemented Interfaces:
  `Predicate<BaseContext>`

public class IPRangePredicate extends Object implements Predicate<BaseContext>
A `Predicate` that checks if a request is from a set of one or more `IPRange`s.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Collection<IPRange>`
`addressRanges`
IP ranges to match against.
`private Supplier<HttpServletRequest>`
`httpRequestSupplier`
Servlet request to evaluate.

## Constructor Summary

Constructors
Constructor
Description
`IPRangePredicate()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`setHttpServletRequestSupplier(Supplier<HttpServletRequest> supplier)`
Set the Supplier for the servlet request to evaluate.
`void`
`setRanges(Collection<IPRange> ranges)`
Set the address ranges to check against.
`boolean`
`test(BaseContext 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

### httpRequestSupplier

@Nullable private Supplier<HttpServletRequest> httpRequestSupplier
Servlet request to evaluate.

### addressRanges

@Nonnull private Collection<IPRange> addressRanges
IP ranges to match against.

## Constructor Details

### IPRangePredicate

IPRangePredicate()
Constructor.

## Method Details

### setRanges

public void setRanges(@Nonnull Collection<IPRange> ranges)
Set the address ranges to check against.

Parameters:
  `ranges` - address ranges to check against
Since:
  3.3.0

### setHttpServletRequestSupplier

public void setHttpServletRequestSupplier(@Nonnull Supplier<HttpServletRequest> supplier)
Set the Supplier for the servlet request to evaluate.

Parameters:
  `supplier` - servlet request supplier to use

### test

public boolean test(@Nullable BaseContext input)

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