Tabnine Logo
Optional.stream
Code IndexAdd Tabnine to your IDE (free)

How to use
stream
method
in
java.util.Optional

Best Java code snippets using java.util.Optional.stream (Showing top 1 results out of 315)

origin: com.yahoo.vespa/node-repository

  /** @return Nodes of type host, in any state, that have no children with allocation */
  static Set<Node> candidates(NodeList nodes) {
    Map<String, Node> hostsByHostname = nodes.nodeType(NodeType.host)
        .asList().stream()
        .collect(Collectors.toMap(Node::hostname, Function.identity()));

    nodes.asList().stream()
        .filter(node -> node.allocation().isPresent())
        .flatMap(node -> node.parentHostname().stream())
        .distinct()
        .forEach(hostsByHostname::remove);

    return Set.copyOf(hostsByHostname.values());
  }
}
java.utilOptionalstream

Popular methods of Optional

  • get
  • orElse
  • isPresent
  • ofNullable
  • empty
  • of
  • map
  • ifPresent
  • orElseThrow
  • orElseGet
  • filter
  • flatMap
  • filter,
  • flatMap,
  • equals,
  • hashCode,
  • toString,
  • isEmpty,
  • <init>,
  • ifPresentOrElse,
  • or

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (Timer)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now