<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __buildLimit(self, query ,limitResMax):
 """Builds limit parameter."""

        limit = query._getParameters()['limit']
        if limitResMax>0 and limitResMax < limit:
            query = UpdateParameter(query, 'limit', limitResMax)
            query = UpdateParameter(query, 'nocount', 'true')        
        elif  limitResMax>0 and  limitResMax >= limit:
            query = UpdateParameter(query, 'nocount', 'true')
        return query