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

org.onetwo.common.utils.map.CamelMap Maven / Gradle / Ivy

There is a newer version: 4.7.2
Show newest version
package org.onetwo.common.utils.map;

import org.onetwo.common.utils.StringUtils;

public class CamelMap extends CaseInsensitiveMap{
	
	final private char sperator;
	
	public CamelMap(int initialCapacity, char sperator) {
		super(initialCapacity);
		this.sperator = sperator;
	}

	public CamelMap(int initialCapacity) {
		this(initialCapacity, '_');
	}
	
	protected Object convertKey(Object key){
		if(key instanceof String){
			key = StringUtils.toCamel(key.toString(), sperator, false);
		}else{
			throw new IllegalArgumentException("key must be a string : " + key);
		}
		return key;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy