Example usage for org.apache.wicket.util.lang Objects defaultIfNull

List of usage examples for org.apache.wicket.util.lang Objects defaultIfNull

Introduction

In this page you can find the example usage for org.apache.wicket.util.lang Objects defaultIfNull.

Prototype

public static <T> T defaultIfNull(T originalObj, T defaultObj) 

Source Link

Document

Returns the original object if this one is != null.

Usage

From source file:com.romeikat.datamessie.core.base.dao.impl.DocumentDao.java

License:Open Source License

private long countInternal(final SharedSessionContract ssc, final DocumentsFilterSettings dfs) {
    // Query for documents
    final DocumentFilterSettingsQuery<Document> query = new DocumentFilterSettingsQuery<Document>(dfs,
            Document.class, sharedBeanProvider);
    final Long count = query.count(ssc);
    return Objects.defaultIfNull(count, 0l);
}

From source file:org.opensingular.form.wicket.mapper.search.SearchModalPanel.java

License:Apache License

private void buildAndAppendModalToRootContainer() {
    modal = new BFModalWindow(ctx.getRootContainer().newChildId(), false, false);
    modal.setTitleText(Model.of(Objects.defaultIfNull(view.getTitle(), StringUtils.EMPTY)));
    modal.setBody(new SearchModalBodyPanel(SELECT_INPUT_MODAL_CONTENT_ID, ctx, (target) -> {
        modal.hide(target);//from   w  ww . ja  va 2  s.com
        target.add(valueField);
        valueField.getBehaviors(AjaxUpdateInputBehavior.class).stream().findFirst()
                .ifPresent(ajax -> ajax.onUpdate(target));
    }));
    ctx.getRootContainer().appendTag("div", modal);
}