package info.bukova.isspst.ui.search;

import info.bukova.isspst.Constants;
import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.Requirement;

public class RequirementResultTransformer extends AbstractResultTransformer implements ResultTransformer {

	@Override
	protected void transform(Object object, SearchResult result) {
		Requirement req = (Requirement)object;
		String moduleName;
		
		if (req.getKind() != null && req.getKind().equals(Constants.REQ_TYPE_SERVICES)) {
			moduleName = StringUtils.localize("ServiceRequirement");
		} else {
			moduleName = StringUtils.localize("MaterialRequirement");
		}
		
		result.setRecordName(moduleName + ": " + req.getNumser());
		result.setDescription(req.getDescription());
	}

}
