package com.bocloud.ims.service.model.cmdb;

import java.util.ArrayList;
import java.util.List;

public class CmdbInfo {

	private String uuid;
	private String moduleCode;
	private String operation;
	private List<CmdbProperty> properties;
	private List<CmdbRelation> relations;

	/**
	 * @return the uuid
	 */
	public String getUuid() {
		return uuid;
	}

	/**
	 * @param uuid
	 *            the uuid to set
	 */
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	/**
	 * @return the moduleCode
	 */
	public String getModuleCode() {
		return moduleCode;
	}

	/**
	 * @param moduleCode
	 *            the moduleCode to set
	 */
	public void setModuleCode(String moduleCode) {
		this.moduleCode = moduleCode;
	}

	/**
	 * @return the operation
	 */
	public String getOperation() {
		return operation;
	}

	/**
	 * @param operation
	 *            the operation to set
	 */
	public void setOperation(String operation) {
		this.operation = operation;
	}

	/**
	 * @return the properties
	 */
	public List<CmdbProperty> getProperties() {
		return properties;
	}

	/**
	 * @param properties
	 *            the properties to set
	 */
	public void setProperties(List<CmdbProperty> properties) {
		this.properties = properties;
	}

	/**
	 * @return the relations
	 */
	public List<CmdbRelation> getRelations() {
		return relations;
	}

	/**
	 * @param relations
	 *            the relations to set
	 */
	public void setRelations(List<CmdbRelation> relations) {
		this.relations = relations;
	}

	public CmdbInfo() {
		super();
	}

	public CmdbInfo(String uuid, String moduleCode, String operation, List<CmdbProperty> properties,
			List<CmdbRelation> relations) {
		super();
		this.uuid = uuid;
		this.moduleCode = moduleCode;
		this.operation = operation;
		this.properties = properties;
		this.relations = relations;
	}

	public void addRelations(CmdbRelation relation) {
		if (relations == null) {
			relations = new ArrayList<>();
		} else {
			relations = new ArrayList<>(relations);
		}
		relations.add(relation);
	}

}
