Example usage for org.apache.commons.lang ArrayUtils isNotEmpty

List of usage examples for org.apache.commons.lang ArrayUtils isNotEmpty

Introduction

In this page you can find the example usage for org.apache.commons.lang ArrayUtils isNotEmpty.

Prototype

public static boolean isNotEmpty(boolean[] array) 

Source Link

Document

Checks if an array of primitive booleans is not empty or not null.

Usage

From source file:uk.ac.ucl.cs.cmic.giftcloud.restserver.PasswordAuthenticationWrapper.java

static Optional<PasswordAuthentication> getPasswordAuthenticationFromUsernamePassword(
        final Optional<String> userName, final Optional<char[]> password) {
    if (userName.isPresent() && password.isPresent() && StringUtils.isNotBlank(userName.get())
            && ArrayUtils.isNotEmpty(password.get())) {
        return Optional.of(new PasswordAuthentication(userName.get(), password.get()));
    } else {//from w  w  w  .  j  av  a 2  s.c  o  m
        return Optional.empty();
    }
}