com.databasesandlife.util.wicket.MapModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-common Show documentation
Show all versions of java-common Show documentation
Utility classes developed at Adrian Smith Software (A.S.S.)
The newest version!
package com.databasesandlife.util.wicket;
import java.util.Map;
import org.apache.wicket.model.IModel;
/**
* Model based on a map.
*
* @author This source is copyright Adrian Smith and licensed under the LGPL 3.
* @see Project on GitHub
*/
public class MapModel implements IModel {
Map map;
K property;
public MapModel(Map map, K property) {
this.map = map;
this.property = property;
}
@Override public void detach() { }
@Override public V getObject() { return map.get(property); }
@Override public void setObject(V object) { map.put(property, object); }
}