package com.atlassian.confluence.extra.workflow;

import com.atlassian.confluence.extra.workflow.model.ConditionModel;

import java.util.Map;
import java.util.Iterator;
import java.util.HashMap;

/**
 * Created by IntelliJ IDEA.
 * User: Tomd
 * Date: 23/05/2005
 * Time: 14:30:45
 * To change this template use File | Settings | File Templates.
 */
public class GroupSetConditionModel implements ConditionModel
{
    GroupSetCondition condition;

    public GroupSetConditionModel(Condition c)
    {
        groups = new HashMap();
        condition = (GroupSetCondition) c;
    }


    private Map groups;



    public void applyChanges(WorkflowType type)
    {
        condition.getAllowedGroups().clear();
        for (Iterator i = groups.keySet().iterator(); i.hasNext();)
        {
            condition.getAllowedGroups().add((String)i.next());
        }
    }

    public Map getGroups()
    {
        return groups;
    }
}
