001/*
002 * Copyright 2011 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl1.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kim.api.jaxb;
017
018import java.io.Serializable;
019import java.util.ArrayList;
020import java.util.List;
021import java.util.Map;
022
023import javax.xml.bind.annotation.XmlAccessType;
024import javax.xml.bind.annotation.XmlAccessorType;
025import javax.xml.bind.annotation.XmlElement;
026import javax.xml.bind.annotation.XmlType;
027
028import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
029
030/**
031 * An XML element that can have zero or more StringMapEntry elements. This is similar
032 * to the StringMapEntryList, except this element's children are <permissionDetail> elements.
033 * 
034 * @author Kuali Rice Team (rice.collab@kuali.org)
035 */
036@XmlAccessorType(XmlAccessType.FIELD)
037@XmlType(name="PermissionDetailListType", propOrder={"permissionDetails"})
038public class PermissionDetailList implements Serializable {
039
040    private static final long serialVersionUID = 1L;
041    
042    @XmlElement(name="permissionDetail")
043    private List<MapStringStringAdapter.StringMapEntry> permissionDetails;
044    
045    public PermissionDetailList() {
046        this.permissionDetails = new ArrayList<MapStringStringAdapter.StringMapEntry>();
047    }
048    
049    public PermissionDetailList(Map<String, String> map) {
050        this();
051        for (Map.Entry<String,String> tempEntry : map.entrySet()) {
052            permissionDetails.add(new MapStringStringAdapter.StringMapEntry(tempEntry));
053        }
054    }
055
056    /**
057     * @return the permissionDetails
058     */
059    public List<MapStringStringAdapter.StringMapEntry> getPermissionDetails() {
060        return this.permissionDetails;
061    }
062
063    /**
064     * @param permissionDetails the permissionDetails to set
065     */
066    public void setPermissionDetails(List<MapStringStringAdapter.StringMapEntry> permissionDetails) {
067        this.permissionDetails = permissionDetails;
068    }
069    
070}