/*
@license.text@
 */
package com.hammurapi.reasoning.tutorial.rules;

import com.hammurapi.reasoning.spi.Infer;
import com.hammurapi.reasoning.tutorial.objectmodel.Child;
import com.hammurapi.reasoning.tutorial.objectmodel.Parent;

public class ParentChildRules {
	
	/**
	 * Infers child relaitonship from parent relationship.
	 * @param parent
	 * @return
	 */
	@Infer
	public Child infer(Parent parent) {
		return new Child(parent.getObject(), parent.getSubject()); 
	}
	
	/**
	 * Infers parent relationship from child relationship
	 * @param child
	 * @return
	 */
	@Infer
	public Parent infer(Child child) {
		return new Parent(child.getObject(), child.getSubject()); 
	}
	
}
