This method returns the first result from the first QueryResult of response, this is equivalent to response.get(0).getResult.get(0).
@return T value if exists, null otherwise
350103
public T firstResult() {
        if (response != null && response.size() > 0) {
            return response.get(0).first();
        }
        return null;
    }
691573
@Nullable
    public T query() throws SQLException {
        try (ResultSet r = executeQuery()) {
            if (r.next()) {
                return resultMapper.map(r);
            }
            return null;
        }
    }
446900
public static <T> T getFirst(List<T> collection)
    {
        return Iterate.isEmpty(collection) ? null : collection.get(0);
    }
528942
public TestResult getFirstNonSuccessfulResult() {
        for (ResponsePayload payload : payloads.values()) {

            if (payload != null) {

                TestResult testResult = payload.getTestResult();

                if (testResult != null) {
                    switch (testResult.getStatus()) {
                        case FAILED:
                            return testResult;
                        case SKIPPED:
                            return testResult;
                        case PASSED:
                    }
                }
            }
        }

        return null;
    }
369264
@Nullable
  public ResultT first() {
    final CoreRemoteMongoCursor<ResultT> cursor = iterator();
    if (!cursor.hasNext()) {
      return null;
    }
    return cursor.next();
  }
665460
public T getFirst() {
        Optional<Rsp<T>> retval=values().stream().filter(rsp -> rsp.getValue() != null).findFirst();
        return retval.isPresent()? retval.get().getValue() : null;
    }
1189601
@Override
	public String getFirst(String headerName) {
		List<String> headerValues = headers.get(headerName);
		return headerValues != null ? headerValues.get(0) : null;
	}
1206836
public function first()
    {
        if ($this->isEmpty()) {
            return $this->makeItem(null);
        }

        $arResultIDList = $this->arElementIDList;

        $iElementID = array_shift($arResultIDList);

        return $this->makeItem($iElementID);
    }
860033
@Override
	public Map<String, Object> first(final CaseFormat caseFormat) {
		return findFirst(caseFormat).orElseThrow(() -> new DataNotFoundException("query result is empty."));
	}
339190
public function first()
	{
		//get the limit clause value
		$limit = $this->limits;

		//get the offset value
		$limitOffset = $this->offset;

		//set the limit to 1
		$this->limit(1);

		//get all
		$all = $this->all();

		//get the first
		$first = ArrayUtility::first($all->result_array())->get();

		//if limit is defined
		if ( $limit ) 
		{
			//set the limit property
			$this->limits = $limit;

		}

		//if limit offset is set
		if ( $limitOffset ) 
		{
			//set the offset
			$this->offset = $limitOffset;

		}

		//get the response object instance
		$this->responseObject
			->setResultArray($first);

		//return the full response object
		return $this->responseObject;

	}
996665
private Object getFirstResult(KunderaQuery query, String field, SearchHits hits, Class clazz, Metamodel metaModel,
            EntityMetadata entityMetadata)
    {
        Object entity;

        if (query.getEntityAlias().equals(field))
        {
            entity = getEntityObjects(clazz, entityMetadata, metaModel.entity(clazz), hits).get(0);
        }
        else
        {
            String jpaField = ((AbstractAttribute) metaModel.entity(clazz).getAttribute(field)).getJPAColumnName();
            entity = query.getSelectStatement().hasGroupByClause() ? hits.getAt(0).sourceAsMap().get(jpaField) : hits
                    .getAt(0).getFields().get(jpaField).getValue();
        }
        return entity;
    }
505277
public function first()
    {
        $data = $this->getData();

        if (!$this->where) {
            return $data
                ? $this->convertItem(reset($data))
                : null;
        }

        foreach ($data as &$rs) {
            if ($this->matchWhere($rs)) {
                return $this->convertItem($rs);
            }
        }

        return null;
    }
699913
public T queryForFirst(DatabaseConnection databaseConnection, PreparedStmt<T> preparedStmt, ObjectCache objectCache)
			throws SQLException {
		CompiledStatement compiledStatement = preparedStmt.compile(databaseConnection, StatementType.SELECT);
		DatabaseResults results = null;
		try {
			compiledStatement.setMaxRows(1);
			results = compiledStatement.runQuery(objectCache);
			if (results.first()) {
				logger.debug("query-for-first of '{}' returned at least 1 result", preparedStmt.getStatement());
				return preparedStmt.mapRow(results);
			} else {
				logger.debug("query-for-first of '{}' returned 0 results", preparedStmt.getStatement());
				return null;
			}
		} finally {
			IOUtils.closeThrowSqlException(results, "results");
			IOUtils.closeThrowSqlException(compiledStatement, "compiled statement");
		}
	}
79578
public V getFirst(Object key) {
        List<V> res = getAll(key);
        if (res.isEmpty()) {
            return null;
        } else {
            return res.iterator().next();
        }
    }
1100523
public Article getFirst() {
		try {
			List<Article> articleList = get();
			if(articleList == null || articleList.size() < 1)
				return null;

			return articleList.get(0);
		} catch (IOException e) {
			return null;
		}
	}
816111
public function getFirst()
    {
        if (0 === count($this->data)) {
            return null;
        }
        reset($this->data);

        return current($this->data);
    }
964664
private static GeocodeApiResponse.Result firstResult(final GeocodeApiResponse apiResponse) {
        if (apiResponse.getStatus() != GeocodeApiResponse.Status.OK) {
            return null;
        }
        final List<GeocodeApiResponse.Result> results = apiResponse.getResults();
        if (results.isEmpty()) {
            return null;
        }
        return results.get(0);
    }