Checks if a document exist in the database.

@param id The document _id field.
@return true If the document is found, false otherwise.
559804
public boolean contains(String id) {
        assertNotEmpty(id, "id");
        InputStream response = null;
        try {
            response = couchDbClient.head(new DatabaseURIHelper(dbUri).documentUri(id));
        } catch (NoDocumentException e) {
            return false;
        } finally {
            close(response);
        }
        return true;
    }
267959
@Override
    public boolean checkIfWorkspaceExists(@NonNull String id) {
        ensureThreadExistense();
        return backingMap.get().containsKey(id);
    }
90617
private boolean isNewId(String id) {

        if (id.contains("#")) {
            id = id.substring(0, id.indexOf("#"));
        }
        return !CmsUUID.isValidUUID(id);
    }
772657
private boolean contains(String ids[], String id) {
	for (int i = 0; i < ids.length; i++) {
	    if (Operator.compare(ids[i], id) == 0) return true;
	}
	return false;
    }
1368620
protected function exists(int $id = 0): bool
    {
        return (bool)@shmop_open($id ? $id : $this->id, 'a', 0, 0);
    }
71444
public boolean exists(long featureId, String database, String table) {
        boolean exists = false;
        Map<String, Map<Long, FeatureShape>> tables = databases.get(database);
        if (tables != null) {

            Map<Long, FeatureShape> featureIds = tables.get(table);
            if (featureIds != null) {
                FeatureShape shapes = featureIds.get(featureId);
                exists = shapes != null && shapes.hasShapes();
            }
        }
        return exists;
    }
997624
public boolean check(int id) {
    for (Tag tag: getTags()) {
      if (tag.getID() == id)
	return true;
    }
    return false;
  }
629604
protected boolean check(String id, List<String> includes, List<String> excludes) {
		return check(id, includes) && !check(id, excludes);
	}
570752
@Override
	public boolean containsNode(long id) {
		return nodeIdMapping.containsKey(id) && !isRemoved(nodes.get(nodeIdMapping.get(id)));
	}
430575
@Transactional(readOnly = true)
	public Event find(Integer id) {
		return em.createQuery("FROM Event WHERE id = :id", Event.class)
				.setParameter("id", id)
				.getSingleResult();
	}
697598
public synchronized boolean containsId(int requestId)
   {		
		if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "containsId", ""+requestId);
	
      testReqIdTableEntry.requestId = requestId;
		boolean result = table.containsKey(testReqIdTableEntry);
		
		if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "containsId", ""+result);
      return result;
   }
256287
public function has($id)
    {
        try {
             $em = $this->entityManager->getDoctrineEntityManager();
             $data = $em->getRepository($this->getEntityClass())->findOneBy(array(
                 'id' => $id,
             ));
             
             if ($data !== null) {
                 return true;
             }
             
             return false;
        } catch (\Exception $e) {
            throw new Exception('Cannot check if there is an entity for the given id "' . $id . '".', 0, $e);
        }
    }
434992
@InterfaceAudience.Private
    public static boolean isValidDocumentId(String id) {
        // http://wiki.apache.org/couchdb/HTTP_Document_API#Documents
        if (id == null || id.length() == 0)
            return false;
        if (id.charAt(0) == '_')
            return (id.startsWith("_design/"));
        return true;
        // "_local/*" is not a valid document ID.
        // Local docs have their own API and shouldn't get here.
    }
967376
def exists(self):
        
        if '_id' not in self or self['_id'] is None:
            return False

        resp = self.r_session.head(self.document_url)
        if resp.status_code not in [200, 404]:
            resp.raise_for_status()

        return resp.status_code == 200
1122275
@Override
    public boolean exist(IESigType esigType, String id) {
        return eSigList.indexOf(esigType, id) >= 0;
    }
1076655
public boolean hasPermissionsById(String id, Collection<Permission> permissions) {
        AuthorizationInfo authorizationInfo = getAuthorizationInfoById(id);
        return authorizationInfo != null && isPermittedAll(permissions, authorizationInfo);
    }
512043
public static boolean collectionExists(MongoDatabase db, String collectionName) {
        return db.listCollections().filter(Filters.eq("name", collectionName)).first() != null;
    }