package com.libreecm.commonAPI.model;

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

import com.libreecm.commonAPI.model.enums.AclPropagation;
import com.libreecm.commonAPI.model.enums.SupportedPermissions;

public class AclCapabilities extends LibreECMObject {

	/**
	 *  
	 */
	@SuppressWarnings("unused")
	private static final long serialVersionUID = 3883886621264859670L;

	private Boolean active;

	/**
	 * @return the active
	 */
	public Boolean getActive() {
		return active;
	}

	/**
	 * @param active the active to set
	 */
	public void setActive(Boolean active) {
		this.active = active;
	}


	private Map<String, PermissionMapping> permissionMappings;
	
	private List<PermissionDefinition> permissions;
	
	private AclPropagation aclPropagation;
	private SupportedPermissions supportedPermissions;

	private List<CmisExtensionElement> cmisExtensionElements;
	
	private String id;
		
	public Map<String, PermissionMapping> getPermissionMappings() {
		return permissionMappings;
	}

	public void setPermissionMappings(Map<String, PermissionMapping> permissionMappings) {
		this.permissionMappings = permissionMappings;
	}

	public String getId() {
		if (id==null)
			return null;
		return (this.id);
	}
	
	public void setId(String id) {
		if (id==null)
			this.id=null;
			else
		this.id=(id);
	}

	public AclCapabilities(){

	}
	
	public AclCapabilities(Map<String, PermissionMapping> permissionMappings, List<PermissionDefinition> permissions,
			AclPropagation aclPropagation, SupportedPermissions supportedPermissions,
			List<CmisExtensionElement> extensions) {
		super();
		this.permissionMappings=permissionMappings;
		this.permissions = permissions;
		this.aclPropagation = aclPropagation;
		this.supportedPermissions = supportedPermissions;
		this.cmisExtensionElements = extensions;
	}

	public void setPermissionMapping(Map<String, PermissionMapping> permissionMappings) {
		this.permissionMappings=permissionMappings;
	}

	public void setPermissions(List<PermissionDefinition> permissions) {
		this.permissions=permissions;
	}

	public void setAclPropagation(AclPropagation aclPropagation) {
		this.aclPropagation = aclPropagation;
	}

	public void setSupportedPermissions(SupportedPermissions supportedPermissions) {
		this.supportedPermissions = supportedPermissions;
	}

	public SupportedPermissions getSupportedPermissions() {
		return supportedPermissions;
	}

	public AclPropagation getAclPropagation() {
		return aclPropagation;
	}

	public List<PermissionDefinition> getPermissions() {
		if (this.permissions==null){
			this.permissions=new ArrayList<>();
		}
		return (this.permissions);
	}
	
	public Map<String, PermissionMapping> getPermissionMapping() {
		if (this.permissionMappings==null){
			this.permissionMappings = new HashMap<String, PermissionMapping>();
		}
		return this.permissionMappings;
	}
	
	public List<CmisExtensionElement> getCmisExtensionElements() {
		if (this.cmisExtensionElements==null){
			this.cmisExtensionElements=new ArrayList<>();
		}
		return this.cmisExtensionElements;
	} 

	public void setCmisExtensionElements(List<CmisExtensionElement> arg0) {
		this.cmisExtensionElements=arg0;		
	}

}
