package com.libreecm.commonAPI.model;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CmisExtensionElement extends LibreECMObject {

	/**  
	 * 
	 */
	private static final long serialVersionUID = -6926969535277403084L;
	
	private Integer id; 

	public String getId(){
		if (id==null){
			return null;
		}
		return this.id.toString();
	}
	
	public void setId(String id){
		this.id=Integer.parseInt(id);
	}
	
	public String getName() {
		return this.name;
	}

	private String name;
	private String namespace;
	private String value;

	private Map<String, String> attributes;
	
    /**
     * A collection of types changed by this repository
    */
	private List<CmisExtensionElement> children;
	
	public CmisExtensionElement(){

		this.id=0;
	}	
	
	public CmisExtensionElement(String name, String namespace, String value, Map<String, String> attributes,
			List<CmisExtensionElement> children) {
		super();
		this.name = name;
		this.namespace = namespace;
		this.value = value;
		this.attributes = attributes;
		this.setChildren(children);
		this.id=0;
	}
 
	
	public String getNamespace() {
		return this.namespace;
	}

	public String getValue() {
		return value;
	}

	public Map<String, String> getAttributes() {
		if (attributes==null){
			attributes = new HashMap<String, String>();
		}
		return attributes;
	}

	public List<CmisExtensionElement> getChildren() {
		if (children == null){
			children = new ArrayList<>();
		}
		return children;
	} 

	public void setName(String name) {
		this.name = name;
	}

	public void setNamespace(String namespace) {
		this.namespace = namespace;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public void setAttributes(Map<String, String> attributes) {
		this.attributes=attributes;
	}

	public void setChildren(List<CmisExtensionElement> arg0) {
		this.children=arg0;
	}
}