API Review: additional methods for StringExpression

Sergey Grinev sergey.grinev at oracle.com
Wed Sep 19 04:22:35 PDT 2012


Hi, Michael.

What do you think about removing isNotEmpty() methods given there is 
BooleanBinding#not() method?

-- Sergey

On 17-Sep-12 15:25, Michael Heinrichs wrote:
> Hi,
>
> I propose six new methods in the high level binding API, adding new functionality for ObservableStringValue's. JIRA issue: http://javafx-jira.kenai.com/browse/RT-21487
>
> In StringExpression:
> public IntegerBinding length();
> public BooleanBinding isEmpty();
> public BooleanBinding isNotEmpty();
>
> In Bindings:
> public static IntegerBinding length(ObservableStringValue);
> public static BooleanBinding isEmpty(ObservableStringValue);
> public static BooleanBinding isNotEmpty(ObservableStringValue);
>
> As usual in the binding API, null is treated similar to an empty String, i.e. length() will return 0, isEmpty() will return true, if the value of an ObservableStringValue is null.
>
>
>
> For consistency I would also like to add isNotEmpty() methods for collections in the Bindings class:
> public static <E> BooleanBinding isNotEmpty(ObservableList<E> op);
> public static <K, V> BooleanBinding isNotEmpty(ObservableMap<K, V> op);
> public static <E> BooleanBinding isNotEmpty(ObservableSet<E> op);
>
> Thanks,
> Michael



More information about the openjfx-dev mailing list