T - - type of the wrapped IModelR - - type of the LambdaModelpublic class LambdaModel<T,R>
extends org.apache.wicket.model.LoadableDetachableModel<R>
LoadableDetachableModel that wraps another IModel and applies
a SerializableFunction to the wrapped model to get the value for the
load() function.
An optional SerializableBiConsumer can be provided that will be
called with the object of the wrapped model and the new object value when the
#setObject() method is called.| Constructor and Description |
|---|
LambdaModel(org.apache.wicket.model.IModel<T> wrappedModel,
SerializableFunction<T,R> loadHandler) |
LambdaModel(org.apache.wicket.model.IModel<T> wrappedModel,
SerializableFunction<T,R> loaderFunction,
SerializableBiConsumer<T,R> setObjectHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected R |
load() |
protected void |
onDetach() |
void |
setObject(R r) |
public LambdaModel(org.apache.wicket.model.IModel<T> wrappedModel, SerializableFunction<T,R> loadHandler)
wrappedModel - IModel that wraps the value which will be applied to
the loadHandler SerializableFunctionloadHandler - SerializableFunction that is invoked to provide the
value for the #load() methodpublic LambdaModel(org.apache.wicket.model.IModel<T> wrappedModel, SerializableFunction<T,R> loaderFunction, SerializableBiConsumer<T,R> setObjectHandler)
wrappedModel - IModel that wraps the value which will be applied to
the loadHandler SerializableFunctionloadHandler - SerializableFunction that is invoked to provide the
value for the #load() methodsetObjectHandler - SerializableBiFunction that is invoked when the
#setObject() method is calledCopyright © 2020. All rights reserved.