panda.lang.collection.MapEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-core Show documentation
Show all versions of panda-core Show documentation
Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.
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);
}
}