Example usage for org.apache.commons.collections4 PredicateUtils notNullPredicate

List of usage examples for org.apache.commons.collections4 PredicateUtils notNullPredicate

Introduction

In this page you can find the example usage for org.apache.commons.collections4 PredicateUtils notNullPredicate.

Prototype

public static <T> Predicate<T> notNullPredicate() 

Source Link

Document

Gets a Predicate that checks if the input object passed in is not null.

Usage

From source file:org.apache.syncope.core.logic.LoggerLogic.java

@PreAuthorize("hasRole('" + StandardEntitlement.AUDIT_LIST + "')")
@Transactional(readOnly = true)//  w w w .j a  v a  2 s  .c  o m
public List<AuditLoggerName> listAudits() {
    return CollectionUtils.collect(IteratorUtils.filteredIterator(list(LoggerType.AUDIT).iterator(),
            PredicateUtils.notNullPredicate()), new Transformer<LoggerTO, AuditLoggerName>() {

                @Override
                public AuditLoggerName transform(final LoggerTO logger) {
                    AuditLoggerName result = null;
                    try {
                        result = AuditLoggerName.fromLoggerName(logger.getKey());
                    } catch (Exception e) {
                        LOG.warn("Unexpected audit logger name: {}", logger.getKey(), e);
                    }

                    return result;
                }
            }, new ArrayList<AuditLoggerName>());
}