Hi devs,
IModel isn't an interface designed to provide a function, it's rather an
interface designed to provide and manipulate (setObject and detach methods)
internal state.
IMO a better alternative to benefit from Java 8 features would be to move
the FunctionalInterface annotation to an interface that actually is
designed to provide one function.
I propose that we add a new interface extending IModel to provide this
functional interface, instead of to misplace it in an interface made for
objects with internal state.
e.g.
@FunctionalInterface
interface IReadyOnlyModel / IModelFunction / IFunction extends from IModel{
default void setObject(final T object)
{
throw new UnsupportedOperationException("unsuported");
}
default void detach()
{
throw new UnsupportedOperationException("unsuported");
}
}
Cheers
Pedro Santos