package com.libreecm.commonAPI.model.objects;

import java.util.List;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.libreecm.commonAPI.model.enums.BaseTypeId;
import com.libreecm.commonAPI.model.enums.PropertyIds;


@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class Relationship extends LibreECMDataObject  {
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3372184321882889186L;
	
	private String sourceId;
	private String targetId;
	
	public Relationship(){
		super();
		//For jackson, setObjectType SHOULD be called first
		this.setObjectType(new RelationshipObjectType());
		this.setBaseTypeId(BaseTypeId.CMIS_RELATIONSHIP);
	}

	public Relationship(Uri uri, ObjectType objectType){
		super(uri, objectType);
	}
	
	public String getSourceId() {
		return this.sourceId;
	}
	
	public String getTargetId(){
		return this.targetId;
	}

	
	/**
	 * @param sourceId the sourceId to set
	 */
	public void setSourceId(String sourceId) {
		if (sourceId==null)return;
		addStringProperty(PropertyIds.SOURCE_ID,sourceId);
		this.sourceId = sourceId;
	}

	/**
	 * @param targetId the targetId to set
	 */
	public void setTargetId(String targetId) {
		if (targetId==null)return;
		addStringProperty(PropertyIds.TARGET_ID,targetId);
		this.targetId = targetId;
	}

}
