Example usage for org.apache.commons.collections4 ListUtils defaultIfNull

List of usage examples for org.apache.commons.collections4 ListUtils defaultIfNull

Introduction

In this page you can find the example usage for org.apache.commons.collections4 ListUtils defaultIfNull.

Prototype

public static <T> List<T> defaultIfNull(final List<T> list, final List<T> defaultList) 

Source Link

Document

Returns either the passed in list, or if the list is null , the value of defaultList .

Usage

From source file:com.thoughtworks.go.plugin.access.authorization.v2.AuthenticationResponseDTO.java

public AuthenticationResponse toDomainModel() {
    return new AuthenticationResponse(this.user != null ? this.user.toDomainModel() : null,
            ListUtils.defaultIfNull(this.roles, Collections.emptyList()));
}

From source file:io.cloudslang.lang.tools.build.SlangBuildMain.java

private static List<String> parseTestSuites(ApplicationArgs appArgs) {
    final List<String> testSuitesArg = ListUtils.defaultIfNull(appArgs.getTestSuites(),
            new ArrayList<String>());
    return ArgumentProcessorUtils.parseTestSuitesToList(testSuitesArg);
}