Example usage for java.util List stream

List of usage examples for java.util List stream

Introduction

In this page you can find the example usage for java.util List stream.

Prototype

default Stream<E> stream() 

Source Link

Document

Returns a sequential Stream with this collection as its source.

Usage

From source file:com.netflix.spinnaker.clouddriver.kubernetes.provider.KubernetesModelUtil.java

private static boolean anyFailed(List<Map<String, String>> healthsList) {
    return healthsList.stream().anyMatch(h -> stateEquals(h, HealthState.Failed));
}

From source file:com.netflix.spinnaker.clouddriver.kubernetes.provider.KubernetesModelUtil.java

private static boolean anyOutOfService(List<Map<String, String>> healthsList) {
    return healthsList.stream().anyMatch(h -> stateEquals(h, HealthState.OutOfService));
}

From source file:org.createnet.raptor.auth.service.acl.RaptorPermission.java

public static List<Permission> fromLabel(List<String> p) {
    return p.stream().map(RaptorPermission::fromLabel).collect(Collectors.toList());
}

From source file:com.u2apple.tool.util.StaticMapFileUtils.java

private static void sortModels(List<VID> vids) {
    vids.stream().forEach((vid) -> {
        sortModels(vid);
    });
}

From source file:Main.java

public static <T> List<T> union(T[] viewLocationsSearched, T[] masterLocationsSearched) {
    // TODO Auto-generated method stub
    List<T> result = Arrays.asList(viewLocationsSearched);
    for (T item : masterLocationsSearched) {
        if (!result.stream().anyMatch(p -> p.equals(item))) {
            result.add(item);//  ww  w  . j av a 2 s.c  om
        }
    }
    return result;
}

From source file:Main.java

public static <K> K getGenericList(List<K> result) {
    if (result == null || result.isEmpty()) {
        return null;
    } else {/*from   w w w .  jav  a2 s.c o  m*/
        return result.stream().findAny().get();
    }
}

From source file:org.createnet.raptor.auth.service.acl.RaptorPermission.java

public static List<String> toLabel(List<Permission> p) {
    return p.stream().map(RaptorPermission::toLabel).collect(Collectors.toList());
}

From source file:com.thoughtworks.go.agent.common.util.JarUtil.java

public static URL[] toURLs(List<File> files) {
    return files.stream().map(file -> {
        try {//from w  w w.  j  a v  a  2 s  .  c o m
            return file.toURI().toURL();
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }).collect(Collectors.toList()).toArray(new URL[0]);
}

From source file:com.epitech.oliver_f.astextexls.MainClass.java

private static void launchWriteAndRead(String folder, String file) {
    ReadXLSFiles readXLSFiles = new ReadXLSFiles(folder);
    List<ResultRow> lRows = readXLSFiles.parse();
    System.out.println("reading ..." + lRows.size());
    lRows.stream().forEach(p -> System.out.println("p : " + p));
    WriteXLSFile writeXLSFile = new WriteXLSFile(lRows, file);
    writeXLSFile.write();/*from ww  w  .  j a  va  2  s  .  c  om*/
}

From source file:com.wrmsr.wava.core.unit.Locals.java

public static Locals of(List<Pair<Name, Type>> pairs) {
    return new Locals(enumerate(pairs.stream())
            .map(e -> new Local(e.getItem().getLeft(), Index.of(e.getIndex()), e.getItem().getRight()))
            .collect(toImmutableList()));
}