Java Properties search(List properties, String term)

Here you can find the source of search(List properties, String term)

Description

search

License

Open Source License

Declaration

public static Map<String, String> search(List<String> properties, String term) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static Map<String, String> search(List<String> properties, String term) {
        Map<String, String> collect = properties.stream().filter(line -> line.split("=")[0].contains(term))
                .map(line -> {//from  w  w  w  .  j  ava 2  s .  c o m
                    Map<String, String> stringStringHashMap = new HashMap<>();
                    stringStringHashMap.put(line.split("=")[0], line.split("=")[1]);
                    return stringStringHashMap;
                }).reduce((stringStringMap, stringStringMap2) -> {
                    stringStringMap.putAll(stringStringMap2);
                    return stringStringMap;
                }).get();

        return collect;
    }
}

Related

  1. propertiesToMap(Properties props)
  2. putAll(final Map props, final Properties p)
  3. putAll(Properties properties, Map result)
  4. putPrefixToProperties(String prefix, Properties pro)
  5. removeDots(Properties props)
  6. setProperty(Properties props, String keyword, Object value)
  7. stringPropertyNames(Properties props, String prefix)
  8. stringToProperties(String str)
  9. toProperties(Map parse)