package performa.orm;

import java.util.SortedSet;
import oneit.utils.CollectionUtils;


public class CultureCriteriaAnswer extends BaseCultureCriteriaAnswer
{
    private static final long serialVersionUID = 0L;
    
    // This constructor should not be called
    public CultureCriteriaAnswer ()
    {
        // Do not add any code to this, always put it in initialiseNewObject
    }
    
    
    //to get relevant culture criteria by job
    public CultureCriteria getCriteriaJob(Job job)
    {
        CultureCriteria criteria    =   null;
        
        if(job!=null)
        {
            SortedSet<CultureCriteria>  cultureCriteriasSet =   job.getCultureCriteriasSet();

            for(CultureCriteria cc: cultureCriteriasSet)
            {
                if(CollectionUtils.equals(cc.getCultureElement(), getCultureElement()))
                {
                    criteria =   cc;
                    
                    break;
                }
            }
        }
        
        return criteria;
    }
}