Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
6.18.0
-
None
-
None
Description
I propose adding static method LoadableDetachableModel/AbstractReadOnlyModel .of(Supplier<T>) so this can be used to quickly create ad-hoc models in Java8 using lambda syntax. (but does not require Java8 in any way). Supplier is from Guava library.
Sample usage:
add(new Label("slug", LoadableDetachableModel.of( () -> personRepo.slugFor(getModelObject()) )));
Similar approach for other abstract classes can also be useful for implementing typically single methods like onSubmit, onClick, onConfigure, etc.