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

panda.lang.collection.MapEntry Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.lang.collection;

import java.util.Map;

/**
 * @param  the key type
 * @param  the value type
 */
public class MapEntry extends KeyValue {
	protected Map map;
	
	/**
	 * Constructs a new pair with the specified key and given value.
	 * 
	 * @param map the map
	 * @param key the key for the entry, may be null
	 * @param value the value for the entry, may be null
	 */
	public MapEntry(Map map, K key, V value) {
		super(key, value);
		this.map = map;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public V setValue(V value) {
		this.value = value;
		return map.put(key, value);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy