title: Java 8, how can I implement a switch statement using streams?
body: <p>I have a text file <code>imgui.ini</code> containing:</p>
  
  <pre><code>[Debug]
  Pos=7,79
  Size=507,392
  Collapsed=0
  
  [ImGui Demo]
  Pos=320,5
  Size=550,680
  Collapsed=0
  </code></pre>
  
  <p>For each "element" I always have <code>Pos</code>, <code>Size</code> and <code>Collapsed</code> and I need to read them.</p>
  
  <p>I would like to use, if possible, java 8 streams.</p>
  
  <p>Is it possible to simulate a switch statement behaviour? </p>
  
  <pre><code>    try (Stream&lt;String&gt; stream = Files.lines(Paths.get(context.io.iniFilename))) {
  
          ...
  /*
      switch(string) {
  
          case "Pos":
              settings.pos = value;
              break;
  
          case "Size":
              settings.size = value;
              break;
  
          case "Collapsed":
              settings.collapsed = value;
              break;
      }
  */
  
      } catch (IOException e) {
      }
  }
  </code></pre>