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

com.databasesandlife.util.wicket.MapModel Maven / Gradle / Ivy

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); }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy