All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.axibase.tsd.driver.jdbc.util.CaseInsensitiveLinkedHashMap Maven / Gradle / Ivy

There is a newer version: 1.4.11
Show newest version
package com.axibase.tsd.driver.jdbc.util;

import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Set;

public class CaseInsensitiveLinkedHashMap extends LinkedHashMap {

    private final Set keys = new HashSet<>();

    public V put(String key, V value) {
        if (notContainsIgnoreCase(key)) {
            return super.put(key, value);
        }
        return null;
    }

    private boolean notContainsIgnoreCase(String key) {
        return key == null ? false : keys.add(key.toLowerCase());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy