title: How can I contains String value with map.key?
body: <p>I have massive of String</p>
  
  <pre><code>String[] mass = new String[]{"textp1","textp2tt","txtp3gfsdg","txtp4rfgsf"}//each element contains substring p1,p2,p3,p4
  </code></pre>
  
  <p>And </p>
  
  <pre><code>Map&lt;String, String&gt; map = new HashMap&lt;&gt;();
  map.put("p1","blablabla");
  map.put("p2","blablabla");
  map.put("p3","blablabla");
  map.put("p4","blablabla");
  </code></pre>
  
  <p>And I want contains each element of mass with key of map</p>
  
  <pre><code>for (String s : mass ) {
    if (s.contains(map.key)) form.setField(map.key,map.value);
   }
  </code></pre>
  
  <p>How can I realize this? Maby not Map?</p>
  
  <p>I want method </p>
  
  <pre><code>public void method(String[] mass, Map&lt;String, String&gt; map){
  for (String s : mass ) {
        if (s.contains(map.key)) form.setField(map.key,map.value);
       }
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I want create map like config and pass like parameter to method. I have some massives of String and I need parse it. cange only 1 parameter p1 or p999</p>