Java Stream Operation firstValue(Stream stream)

Here you can find the source of firstValue(Stream stream)

Description

first Value

License

Apache License

Declaration

public final static <T> T firstValue(Stream<T> stream) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.stream.Stream;

public class Main {
    public final static <T> T firstValue(Stream<T> stream) {
        return stream.findAny().get();
    }// ww w .j  a  v  a2 s . com
}

Related

  1. filterInstances(Stream stream, Class clazz)
  2. filterType(Stream stream, Class type)
  3. findLast(Stream s)
  4. findLastOf(Stream stream)
  5. findStreamAmongst(Class clazz, Collection instances)
  6. flatOptionals(Stream> list)
  7. flattenFeatureStreamToMap( Stream>>> stream)
  8. gcd(IntStream numbers)
  9. getOSIllegalCharacterStream(String path)