Example usage for java.util LinkedHashMap LinkedHashMap

List of usage examples for java.util LinkedHashMap LinkedHashMap

Introduction

In this page you can find the example usage for java.util LinkedHashMap LinkedHashMap.

Prototype

public LinkedHashMap() 

Source Link

Document

Constructs an empty insertion-ordered LinkedHashMap instance with the default initial capacity (16) and load factor (0.75).

Usage

From source file:com.mirth.connect.server.migration.Migrate3_1_1.java

@Override
public Map<String, Object> getConfigurationPropertiesToAdd() {
    Map<String, Object> propertiesToAdd = new LinkedHashMap<String, Object>();

    propertiesToAdd.put("https.client.protocols", "TLSv1.2,TLSv1.1");
    propertiesToAdd.put("https.server.protocols", "TLSv1.2,TLSv1.1,SSLv2Hello");
    propertiesToAdd.put("https.ciphersuites",
            "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_DSS_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_DSS_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384,TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDH_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_DSS_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_DSS_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,TLS_EMPTY_RENEGOTIATION_INFO_SCSV");

    return propertiesToAdd;
}

From source file:hmp.Read.java

public Read(String header, Properties props) {
    sequenceBuilder = new StringBuilder();
    rdpResultHash = new LinkedHashMap<String, SummaryStatistics>();
    this.header = header;
    String delimiter = props.getProperty("readDelimiter");
    if (delimiter.equalsIgnoreCase("space")) {
        delimiter = "\\s+";
    }/*from  www.j  ava 2  s  . c om*/
    String[] headerData = header.split(delimiter);
    this.id = headerData[Integer.valueOf(props.getProperty("readNameIndex"))].replace(">", "");
}

From source file:com.mapr.data.sputnik.util.JsonUtils.java

public String flattenJson(String json) throws IOException {
    Map<String, Object> outputMap = new LinkedHashMap<>();
    flattenJsonIntoMap("", mapper.readTree(json), outputMap);
    return mapper.writeValueAsString(outputMap);
}

From source file:cz.hobrasoft.pdfmu.PdfmuUtils.java

/**
 * Converts an array of keys and an array of values to a {@link Map}.
 *
 * @param <K> the type of keys./*  www .  j  a  v a 2 s .  co m*/
 * @param <V> the type of values.
 * @param keys the array of keys. Only the keys that have a matching value
 * are used.
 * @param values the array of values. Only the values that have a matching
 * key are used.
 * @return a {@link Map} that contains a key-value pair for each index in
 * keys and values. The order of the entries is preserved by the underlying
 * implementation ({@link LinkedHashMap}).
 */
// TODO: Rename
public static <K, V> Map<K, V> sortedMap(K[] keys, V[] values) {
    Map<K, V> result = new LinkedHashMap<>();
    int n = Math.min(keys.length, values.length);
    for (int i = 0; i < n; ++i) {
        result.put(keys[i], values[i]);
    }
    return result;
}

From source file:org.kitodo.data.index.elasticsearch.type.DocketType.java

@SuppressWarnings("unchecked")
@Override//from w ww.  ja  v a  2  s  . co  m
public HttpEntity createDocument(Docket docket) {

    LinkedHashMap<String, String> orderedDocketMap = new LinkedHashMap<>();
    orderedDocketMap.put("name", docket.getName());
    orderedDocketMap.put("file", docket.getFile());
    JSONObject docketObject = new JSONObject(orderedDocketMap);

    return new NStringEntity(docketObject.toJSONString(), ContentType.APPLICATION_JSON);
}

From source file:com.nbt.data.Register.java

public Register() {
    this.map = new LinkedHashMap<Integer, E>();
}

From source file:org.kitodo.data.index.elasticsearch.type.RulesetType.java

@SuppressWarnings("unchecked")
@Override/*from   w w  w  . ja  v  a  2s .  co  m*/
public HttpEntity createDocument(Ruleset ruleset) {

    LinkedHashMap<String, String> orderedRulesetMap = new LinkedHashMap<>();
    orderedRulesetMap.put("title", ruleset.getTitle());
    orderedRulesetMap.put("file", ruleset.getFile());
    orderedRulesetMap.put("fileContent", "");
    JSONObject rulesetObject = new JSONObject(orderedRulesetMap);

    return new NStringEntity(rulesetObject.toJSONString(), ContentType.APPLICATION_JSON);
}

From source file:com.cprassoc.solr.auth.model.HistoryVersion.java

private void init() {
    history = new LinkedHashMap<>();
    try {/*  ww  w  .ja v a  2  s. c  om*/
        if (!historyDir.exists()) {
            historyDir.mkdirs();
        } else {
            FilenameFilter fileNameFilter = new FilenameFilter() {

                @Override
                public boolean accept(File dir, String name) {
                    if (name.contains(".json")) {

                        return true;
                    }

                    return false;
                }
            };
            File[] files = historyDir.listFiles(fileNameFilter);
            File file;
            String json;
            JSONObject jsonObj;
            for (int i = 0; i < files.length; i++) {
                file = files[i];
                json = Utils.streamToString(new FileInputStream(file));
                jsonObj = new JSONObject(json);
                String key = jsonObj.getString("key");
                JSONObject data = new JSONObject(jsonObj.getString("data"));
                String title = jsonObj.getString("title");
                String desc = jsonObj.getString("description");
                Date date = new Date(jsonObj.getString("date"));

                SecurityJson secu = new SecurityJson(data);
                SavedVersion version = new SavedVersion(title, desc, date, secu);
                Log.log(getClass(), "Adding Version: " + version.getTitle());
                this.history.put(key, version);
            }
        }

    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:controllers.BBProxy.java

public static F.Promise<Result> index(String query) {

    if (StringUtils.isEmpty(query)) {

        F.Promise.promise(new F.Function0<Object>() {
            @Override//  w  w  w .j av a 2  s.c  om
            public Object apply() throws Throwable {
                return ok(Json.toJson("Query parameter (q) not provided "));
            }

        });
    }

    F.Promise<WSResponse> wsResponsePromise = WS.url("http://www.bloomberg.com/search")
            .setQueryParameter("query", query).get();

    return wsResponsePromise.map(new F.Function<WSResponse, Result>() {
        @Override
        public Result apply(WSResponse wsResponse) throws Throwable {

            String body = wsResponse.getBody();

            List<Map<String, String>> ret = new ArrayList<Map<String, String>>();

            try {
                // Insert into map
                org.jsoup.nodes.Document doc = Jsoup.parse(body);
                Elements items = doc.getElementsByClass("search-result");

                for (Element item : items) {
                    Map<String, String> keyValue = new LinkedHashMap<String, String>();

                    keyValue.put("image",
                            item.getElementsByClass("search-result-story__thumbnail__image").attr("src"));
                    keyValue.put("title", item.getElementsByClass("search-result-story__headline").text());

                    int index = item.getElementsByClass("search-result-story__body").text()
                            .indexOf(" (Source: Bloomberg");

                    if (index == -1) {
                        keyValue.put("content", item.getElementsByClass("search-result-story__body").text());
                    } else {
                        keyValue.put("content", item.getElementsByClass("search-result-story__body").text()
                                .substring(0, index));
                    }

                    keyValue.put("date", item.getElementsByClass("published-at").text());
                    keyValue.put("url", "www.bloomberg.com/"
                            + item.getElementsByClass("search-result-story__thumbnail__link").attr("href"));

                    ret.add(keyValue);
                }

            } catch (DOMException e) {
                e.printStackTrace();
            }

            return ok(Json.toJson(ret));
        }
    });
}

From source file:com.mirth.connect.server.migration.Migrate3_2_2.java

@Override
public Map<String, Object> getConfigurationPropertiesToAdd() {
    Map<String, Object> propertiesToAdd = new LinkedHashMap<String, Object>();

    propertiesToAdd.put("server.includecustomlib", new MutablePair<Object, String>(true,
            "Determines whether libraries in the custom-lib directory will be included on the server classpath.\nTo reduce potential classpath conflicts you should create Resources and use them on specific channels/connectors instead, and then set this value to false."));

    return propertiesToAdd;
}