Test if the specified key exists.

@param key

@return

@throws Exception
186109
public boolean exists(String key) throws Exception {
        boolean isExist = false;
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            isExist = jedis.exists(SafeEncoder.encode(key));

        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            this.jedisPool.returnBrokenResource(jedis);
            throw e;
        } finally {
            if (jedis != null) {
                this.jedisPool.returnResource(jedis);
            }
        }
        return isExist;
    }
1056776
public boolean containsKey(final Object key)
    {
        @DoNotSub final int mask = values.length - 1;
        @DoNotSub int index = Hashing.hash(key, mask);

        boolean found = false;
        while (missingValue != values[index])
        {
            if (key.equals(keys[index]))
            {
                found = true;
                break;
            }

            index = ++index & mask;
        }

        return found;
    }
42312
@Override
    public boolean contains(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        return indexForColumnName(key) >= 0;
    }
863536
public void setKey(String key) {
        if (!isValidParamKey(key)) {
            throw ExceptionUtils.buildRuntime("param.key", key, "key can not start with "
                + RpcConstants.HIDE_KEY_PREFIX + " and " + RpcConstants.INTERNAL_KEY_PREFIX);
        }
        this.key = key;
    }
49148
@Override
    public boolean containsKey(Object key) {
        return key == null ? (indexOfNull() >= 0) : (indexOf(key, key.hashCode()) >= 0);
    }
221107
private boolean propertyExists(String key) {
        String value = getProperty(key);
        return (null != value && 0 < value.length());
    }
541855
public boolean containsValues(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetValues().getMap().containsKey(key);
  }
163598
@Override
    public boolean existsSetItem(String key, V value) {
        return existsSetItemAsync(key, value).join();
    }
580536
public boolean containsKey(Object key) {
        if (key instanceof Number) {
            return containsKey( ((Number)key).intValue() );
        }
        else {
            return false;
        }
    }
1084557
public final void updateKey(String key) throws IOException {
    Objects.requireNonNull(key, "old key required");
    if (index.containsKey(key)) {
      MtasSolrStatus status = index.get(key);
      index.remove(key);
      if (!index.containsKey(status.key())) {
        index.put(status.key(), status);
      } else {
        throw new IOException("key already exists");
      }
    }
  }
1285160
protected boolean hasKey(final String key, final JSONObject jsonObject) {
    return jsonObject != null
           && jsonObject.has(key);
  }
2873
public boolean containsKey(Object key) {
        return isValidKey(key) && vals[((Enum<?>)key).ordinal()] != null;
    }
1293869
public function has($key)
    {
        if (null === $key) {
            throw new Exception\InvalidArgumentException('The specified key name is null');
        }

        if (!is_scalar($key)) {
            throw new Exception\InvalidArgumentException('The specified key name must be a scalar');
        }

        return array_key_exists($key, $this->collections);
    }
13818
private void fail(final K key) {
        final String methodName = "fail(): ";
        stateLock.writeLock().lock();
        try {
            Integer index = actualIndices.remove(key);
            if (index == null)
                throw new IllegalArgumentException("unknown key: " + key);
            elements[index] = FAILED;
            // register that this key failed
            (failedKeys == null ? failedKeys = new ArrayList<K>(actualIndices.size() + 1) : failedKeys).add(key);
            checkForCompletion();
            if (tc.isDebugEnabled())
                Tr.debug(tc, methodName, "permanent fail for key " + key);
            stateLock.postEvent();
        } finally {
            stateLock.writeLock().unlock();
        }
    }
554174
private boolean checkIfKeyExists(String key)
    {
        if (aggregationsKeySet == null)
        {
            aggregationsKeySet = new HashSet<String>();
        }
        return aggregationsKeySet.add(key);
    }
139314
public boolean containsRet(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetRet().getMap().containsKey(key);
  }
16434
public function keyExists($key)
    {
        $exists = true;
        try {
            $this->get($key);
        } catch (Exception $e) {
            $exists = false;
        }
        return $exists;
    }