package org.jerrymouse.gaes.mavenPlugin.archetype;

import org.apache.maven.model.Model;
import org.apache.maven.model.ModelBase;

public class ModelPatchImpl implements ModelPatch {

	@Override
	public Model patch(Model model, Patch patch) {
		if (patch.removeParent) {
			model.setParent(null);
		}
		if (patch.addParent != null) {
			model.setParent(patch.addParent);
		}
		if (patch.removeDistributionManagement == true) {
			model.setDistributionManagement(null);
		}
		return model;
	}

}
