Commit f6d2ee1a by Tuomas Riihimäki

... add missing file

1 parent ed593358
package fi.codecrew.moya.rest.pojo.placemap;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.Product;
import fi.codecrew.moya.rest.pojo.ProductRestPojo;
@XmlRootElement
public class PlacemapMapRootPojo {
private MapPojo map;
private List<ProductRestPojo> products;
private static final Logger logger = LoggerFactory.getLogger(PlacemapMapRootPojo.class);
public PlacemapMapRootPojo() {
}
public static class MapPojo {
private EventMap map;
public MapPojo() {
}
public MapPojo(EventMap map2) {
this.map = map2;
}
@XmlElement(name = "name")
public String getName() {
return map.getName();
}
@XmlElement(name = "id")
public Integer getId() {
return map.getId();
}
@XmlElement(name = "width")
public Integer getWidth() {
return map.getWidth();
}
@XmlElement(name = "height")
public Integer getHeight() {
return map.getHeight();
}
}
public List<ProductRestPojo> getProducts() {
return products;
}
public void setProducts(List<ProductRestPojo> products) {
this.products = products;
}
public void setMap(EventMap map2) {
logger.info("Adding map {} to placemapMap", map2);
map = new MapPojo(map2);
}
public void setRawProducts(List<Product> mapProducts) {
products = new ArrayList<>();
for (Product p : mapProducts) {
logger.warn("Adding product {}", p);
products.add(new ProductRestPojo(p));
}
}
public MapPojo getMap() {
return map;
}
public void setMap(MapPojo map) {
this.map = map;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!