class CriteriaTypeFactory {

    public CriteriaType newCriteriaType(String type)
    {
        CriteriaType criteriaType = null;
        Class<? extends CriteriaType> typeClass = myCriteriaTypes.get(type);
        if (typeClass != null)
        {
            try
            {
                Constructor<? extends CriteriaType> constructor = typeClass.getConstructor();
                criteriaType = constructor.newInstance();
            }
            catch (NoSuchMethodException | InstantiationException | InvocationTargetException | IllegalAccessException e)
            {
                LOGGER.error(e, e);
            }
        }

        return criteriaType;
    }

    private  CriteriaTypeFactory();

}