public class StaticValueResolver<T> extends Object implements ValueResolver<T>
ValueResolver which always returns the same constant value.| Constructor and Description |
|---|
StaticValueResolver(T value) |
| Modifier and Type | Method and Description |
|---|---|
static <T> StaticValueResolver<T> |
fromUnwrapped(Object value)
Creates a new instance considering that the
value could have some kind of wrapper. |
boolean |
isDynamic()
Returns
false if subsequent invocations to ValueResolver.resolve(ValueResolvingContext) will return the same value. |
T |
resolve(ValueResolvingContext context)
Resolves a value from the given
event |
public StaticValueResolver(T value)
public static <T> StaticValueResolver<T> fromUnwrapped(Object value)
value could have some kind of wrapper.
Current implementation only considers the Optional, using orElse(null) as the mapping function.
T - the value's generic typevalue - a possibly wrapped valueStaticValueResolver pointing to the unwrapped valuepublic T resolve(ValueResolvingContext context) throws org.mule.runtime.api.exception.MuleException
eventresolve in interface ValueResolver<T>context - the context for the current resolution attemptorg.mule.runtime.api.exception.MuleException - if the resolution of the value failspublic boolean isDynamic()
ValueResolverfalse if subsequent invocations to ValueResolver.resolve(ValueResolvingContext) will return the same value. Notice
that if it returns true, then it might return different values per invocation but that's not guaranteed.isDynamic in interface ValueResolver<T>falseCopyright © 2003–2022 MuleSoft, Inc.. All rights reserved.