public class SerializableLazyValue<T extends Serializable> extends LazyValue<T> implements Serializable
LazyValue that adds logic for serialization. In order to work properly, values must implement the
Serializable interface.
While serializing, if the value was not yet resolved, it will be. As a consequence, LazyValue.isComputed() will return
different values before and after serialization.initialized, value, valueSupplier| Constructor and Description |
|---|
SerializableLazyValue(Supplier<T> supplier) |
SerializableLazyValue(T value) |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
flatMap(Function<T,R> function)
Applies the given
function through the output of LazyValue.get(). |
T |
get()
Returns the lazy value.
|
ifComputed, isComputedpublic SerializableLazyValue(T value)
public T get()
LazyValueget in interface Supplier<T extends Serializable>get in class LazyValue<T extends Serializable>public <R> R flatMap(Function<T,R> function)
LazyValuefunction through the output of LazyValue.get().
If the value has not already been computed, this method will trigger computation. This method is thread-safe.flatMap in class LazyValue<T extends Serializable>R - the generic type of the function's outputfunction - a transformation functionCopyright © 2025 MuleSoft, Inc.. All rights reserved.