AppJars / commons-frontend

Commons utilities for front-end enterprise features
Apache License 2.0
1 stars 1 forks source link

Vaadin utils - inline configuration helper #3

Closed javier-godoy closed 2 years ago

javier-godoy commented 2 years ago

The following is loosely inspired in Kotlin fluent methods

public static <T> T __(T t, Consumer<T> consumer) {
    consumer.accept(t);
    return t;
}

it allows you write short one-liners such as add(__(new TextField(), tf -> tf.setWidth("500px")))


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.