package org.ow2.proactive.procci.model.occi.metamodel.rendering;

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

/**
 * Created by mael on 16/09/16.
 */
public class EntitiesRendering {

    private final Map<String,EntityRendering> entities;

    private EntitiesRendering(Map<String,EntityRendering> entities) {
        this.entities = entities;
    }

    public static class Builder{
        private final Map<String,EntityRendering> entities;

        public Builder(){
            entities = new HashMap<>();
        }

        public Builder addEntity(EntityRendering entity){
            this.entities.put(entity.getId(),entity);
            return this;
        }

        public Builder addEntities(List<EntityRendering> results) {
            results.stream().forEach( entityRendering -> this.addEntity(entityRendering));
            return this;
        }

        public EntitiesRendering build(){
            return new EntitiesRendering(entities);
        }

    }
}

@@ -59,16 +59,72 @@
 ering;%0A%0A
+import lombok.EqualsAndHashCode;%0Aimport lombok.Getter;%0A%0A
 import j
@@ -198,40 +198,67 @@
 %0A * 
-Created by mael on 16/09/16.%0A */
+Rendering model for entities%0A */%0A@Getter%0A@EqualsAndHashCode
 %0Apub

remove bug which prevent swagger to use the rendering