Limit the number of results in the response, if supported by the server. A negative value will remove the limit.

@param limit
The maximum number of result in the response if this is a positive integer.
@return This instance.
517581
public AddressbookQuery limitNumberOfResults(int limit)
	{
		if (limit > 0)
		{
			addLimit(WebDavSearch.NRESULTS, limit);
		}
		else
		{
			removeLimit(WebDavSearch.NRESULTS);
		}
		return this;
	}
1045374
@Override
    public java.util.concurrent.Future<ListTablesResult> listTablesAsync(Integer limit) {

        return listTablesAsync(new ListTablesRequest().withLimit(limit));
    }
919078
public function limit(int $limit = 0): Select
    {
        if (!\is_int($limit) || $limit <= 0) {
            throw new InvalidArgumentException('$limit have to be a positive integer');
        }
        $this->limit = $limit;
        return $this;
    }
512436
@Override
    public void registerLimit(final long limit) {

        if (queues.size() > 0) {
            if (unlimited.get(currentQueue())
                         .get())
                limits.get(currentQueue())
                      .set(0);

            limits.get(currentQueue())
                  .addAndGet(limit);
            unlimited.get(currentQueue())
                     .set(false);

            queues.stream()
                  .forEach(this::closeQueueIfFinishedStateless);

        }
    }
1315266
public static List<Integer> randomSerial(int limit) {
        List<Integer> list = new ArrayList<Integer>(limit);

        for (int ix = 0; ix < limit; ++ix) {
            list.add(ix);
        }

        Collections.shuffle(list, new Random());
        return list;
    }
1204469
@Nonnull
  public TypeaheadDataset setLimit (@Nonnegative final int nLimit)
  {
    ValueEnforcer.isGT0 (nLimit, "Limit");
    m_nLimit = nLimit;
    return this;
  }
788384
public function limit($limit, $offset = null)
    {
        $this->queryBuilder->setLimit($limit, $offset);
        return $this;
    }
1036422
public static String toStringLimited(ImmutableSet<?> items, int limit) {
    if (items.size() <= limit) {
      return items.toString();
    } else {
      return items.asList().subList(0, limit).toString() + "... (" + (items.size() - limit) + " more)";
    }
  }
1324558
public function limit($limit = null)
    {
        if (isset($limit)) {
            $this->setLimit($limit);

            return $this;
        }

        return $this->getLimit();
    }
488111
def limit(self, limit):
    
    params = join_params(self.parameters, {"limit": limit})

    return self.__class__(**params)
1186216
private function rowLimiter(int $limit = 1000): Closure
    {
        return static function () use ($limit): void {
            static $n = 0;

            if (++$n > $limit) {
                $message = I18N::translate('The search returned too many results.');

                throw new InternalServerErrorException($message);
            }
        };
    }
426728
public boolean limit() {

        //get connection
        Object connection = getConnection();

        Object result = limitRequest(connection);

        if (FAIL_CODE != (Long) result) {
            return true;
        } else {
            return false;
        }
    }
177391
@com.fasterxml.jackson.annotation.JsonProperty("limitType")
    public void setLimitType(String limitType) {
        this.limitType = limitType;
    }
13084
public function limit($start, $limit = null) {
        if ($limit === null) {
            $limit = intval($start);
            $start = 0;
        } else {
            $start = intval($start);
            $limit = intval($limit);
        }
        if ($start < 0) {
            $start = 0;
        }
        if (!$limit) {
            $limit = 1;
        }
        $this->limit = [$start, $limit];
        if ($this->statement) {
            $this->updateWhereData([':limit_0' => $start, ':limit_1' => $limit]);
        }

        return $this;
    }
1084243
public function limit($limit)
    {
        if (null !== $limit) {
            if (!is_numeric($limit) || $limit != (int) $limit) {
                throw new \InvalidArgumentException('The limit is not valid.');
            }
            $limit = (int) $limit;
        }

        $this->limit = $limit;

        return $this;
    }
1282305
private void onLimit(StringBuilder builder) {
        if (Integer.MAX_VALUE != maxResult) {
            builder.append(CQLTranslator.LIMIT);
            builder.append(isSingleResult ? 1 : this.maxResult);
        }
    }
648240
public static String genLimitSQL(Integer offset, Integer limit) {
		StringBuilder sb = new StringBuilder();
		if (limit != null) {
			sb.append(" limit ");
			if(offset != null) {
				sb.append(offset).append(",");
			}
			sb.append(limit);
		}
		return sb.toString();
	}