package org.eclipse.cosmos.me.sdd.tooling.btg.aggregator.comparisons;

import org.eclipse.cosmos.me.sdd.schema.ObjectFactory;
import org.eclipse.cosmos.me.sdd.schema.RequiredBaseType;

public class RequiredBaseCompare
{
//	DisplayElementGroup 	 	 DisplayElementGroup 	 Merge
//	Alternative 		<AlternativeRequiredBaseConstraintType> 	Merge
//	ResourceConstraint 		<RequiredBaseConstraintType> 	Merge

	protected static RequiredBaseType merge(RequiredBaseType rb, RequiredBaseType rb2)
	{
		ObjectFactory objectFactory = new ObjectFactory();
		RequiredBaseType merged = objectFactory.createRequiredBaseType();
		merged.getAlternative().addAll(AlternativeRequiredBaseConstraintCompare.merge(rb.getAlternative(),rb2.getAlternative()));
		merged.setDescription(DisplayTextCompare.merge(rb.getDescription(), rb2.getDescription()));
		merged.setDisplayName(DisplayTextCompare.merge(rb.getDisplayName(), rb2.getDisplayName()));
		merged.setShortDescription(DisplayTextCompare.merge(rb.getShortDescription(), rb2.getShortDescription()));
		merged.getResourceConstraint().addAll(RequiredBaseConstraintCompare.merge(rb.getResourceConstraint(),rb2.getResourceConstraint()));
		return merged;
	}

}
