You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 10, 2023. It is now read-only.
ValueProvider extends SerializableFunction. However, one cannot use Function.compose because the return type of Function.compose is Function instead of ValueProvider
Consider the following helper method:
public static <R, T, V> ValueProvider<T, V> compose(final ValueProvider<? super T, ? extends R> this_,
final ValueProvider<? super R, ? extends V> after) {
Objects.requireNonNull(this_);
Objects.requireNonNull(after);
return (T t) -> Optional.ofNullable(this_.apply(t)).map(after).orElse(null);
}
it allows you to specifiy a ValueProvider by composing method references grid.addColumn(compose(Person::getAddress, Address::getCity)) instead of grid.addColumn(p->Optional.ofNullable(p.getAddress()).map(Address::getCity))
This contribution contains Personal Intellectual Property that is and remains owned by its Author. To the fullest extent possible, the Appjars Project and its controlling shareholder are granted a non-exclusive, irrevocable and transferable license under the terms stated in section 1(D) of the Amendment to the Agreement on Intellectual Property in effect.
ValueProviderextendsSerializableFunction. However, one cannot useFunction.composebecause the return type ofFunction.composeisFunctioninstead ofValueProviderConsider the following helper method:
it allows you to specifiy a
ValueProviderby composing method referencesgrid.addColumn(compose(Person::getAddress, Address::getCity))instead ofgrid.addColumn(p->Optional.ofNullable(p.getAddress()).map(Address::getCity))This contribution contains Personal Intellectual Property that is and remains owned by its Author. To the fullest extent possible, the Appjars Project and its controlling shareholder are granted a non-exclusive, irrevocable and transferable license under the terms stated in section 1(D) of the Amendment to the Agreement on Intellectual Property in effect.