Package net.shibboleth.shared.spring.expression

# Class SpringExpressionBiFunction<T,U,V>

java.lang.Object
net.shibboleth.shared.spring.expression.AbstractSpringExpressionEvaluator
net.shibboleth.shared.spring.expression.SpringExpressionBiFunction<T,U,V>

Type Parameters:
  `T` - first input type
  `U` - second input type
  `V` - return type

All Implemented Interfaces:
  `BiFunction<T,U,V>`

public class SpringExpressionBiFunction<T,U,V> extends AbstractSpringExpressionEvaluator implements BiFunction<T,U,V>
Predicate whose condition is defined by an Spring EL expression.

Since:
  6.1.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Pair<Class<T>,Class<U>>`
`inputTypes`
Input types.
`private final org.slf4j.Logger`
`log`
Class logger.

## Constructor Summary

Constructors
Constructor
Description
`SpringExpressionBiFunction(String expression)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`V`
`apply(T first, U second)`
`Pair<Class<T>,Class<U>>`
`getInputTypes()`
Get the input type to be enforced.
`protected void`
`prepareContext(EvaluationContext context, Object... input)`
Pre-process the script context before execution.
`void`
`setInputTypes(Pair<Class<T>,Class<U>> types)`
Set the input types to be enforced.
`void`
`setOutputType(Class<?> type)`
Set the output type to be enforced.
`void`
`setReturnOnError(Object value)`
Set value to return if an error occurs.

### Methods inherited from class net.shibboleth.shared.spring.expression.AbstractSpringExpressionEvaluator

`evaluate, getCustomObject, getOutputType, getReturnOnError, setCustomObject, setHideExceptions`

### 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.BiFunction

`andThen`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### inputTypes

@Nullable private Pair<Class<T>,Class<U>> inputTypes
Input types.

## Constructor Details

### SpringExpressionBiFunction

public SpringExpressionBiFunction(@Nonnull @NotEmpty @ParameterName(name="expression") String expression)
Constructor.

Parameters:
  `expression` - the expression to evaluate

## Method Details

### getInputTypes

@Nullable public Pair<Class<T>,Class<U>> getInputTypes()
Get the input type to be enforced.

Returns:
  input type

### setInputTypes

public void setInputTypes(@Nullable Pair<Class<T>,Class<U>> types)
Set the input types to be enforced.

Parameters:
  `types` - the input types

### setOutputType

public void setOutputType(@Nullable Class<?> type)
Set the output type to be enforced.

Overrides:
  `setOutputType` in class `AbstractSpringExpressionEvaluator`
Parameters:
  `type` - output type

### setReturnOnError

public void setReturnOnError(@Nullable Object value)
Set value to return if an error occurs.

Overrides:
  `setReturnOnError` in class `AbstractSpringExpressionEvaluator`
Parameters:
  `value` - value to return

### apply

@Nullable public V apply(@Nullable T first, @Nullable U second)

Specified by:
  `apply` in interface `BiFunction<T,U,V>`

### prepareContext

protected void prepareContext(@Nonnull EvaluationContext context, @Nullable Object... input)
Pre-process the script context before execution.

Specified by:
  `prepareContext` in class `AbstractSpringExpressionEvaluator`
Parameters:
  `context` - the expression context
  `input` - the inputs