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

org.archive.crawler.restlet.models.ViewModel Maven / Gradle / Ivy

The newest version!
package org.archive.crawler.restlet.models;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.archive.crawler.restlet.Flash;

@SuppressWarnings("serial")
public class ViewModel extends LinkedHashMap {
    public ViewModel(){
        super();
    }
    public void setFlashes(List flashes){
        List> flashList = new ArrayList>();
        this.put("flashes", flashList);
        for(Flash flash: flashes) {
            Map flashModel = new HashMap();
            flashModel.put("kind", flash.getKind());
            flashModel.put("message", flash.getMessage());
            flashList.add(flashModel);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy