Checks if container/object exists and verifies that it contains
Data-Origin=stocator metadata If so, object was created by Spark.

@param objectKey the key of the object
@return boolean if object was created by Spark
15264
private boolean isSparkOrigin(String objectKey) {
    LOG.debug("check spark origin for {}", objectKey);
    if (!objectKey.endsWith("/")) {
      LOG.debug("Key {} has no slash. Return false", objectKey);
      return false;
    } else {
      objectKey = objectKey.substring(0, objectKey.length() - 1);
    }

    if (mCachedSparkOriginated.containsKey(objectKey)) {
      boolean res = mCachedSparkOriginated.get(objectKey).booleanValue();
      LOG.debug("found cached for spark origin for {}. Status {}", objectKey, res);
      return res;
    }
    String key = getRealKey(objectKey);
    Boolean sparkOriginated = Boolean.FALSE;
    ObjectMetadata objMetadata = getObjectMetadata(key);
    if (objMetadata != null) {
      Object sparkOrigin = objMetadata.getUserMetaDataOf("data-origin");
      if (sparkOrigin != null) {
        String tmp = (String) sparkOrigin;
        if (tmp.equals("stocator")) {
          sparkOriginated = Boolean.TRUE;
        }
      }
    }
    mCachedSparkOriginated.put(key, sparkOriginated);
    LOG.debug("spark origin for {} is {} non cached", objectKey, sparkOriginated.booleanValue());
    return sparkOriginated.booleanValue();
  }
1160993
public <T> boolean containsKey(Key<T> key) {
        if (key == null) {
            throw new IllegalArgumentException("key must not be null");
        }
        return data.containsKey(key.getName());
    }
1268943
public boolean containsLostStorage(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetLostStorage().getMap().containsKey(key);
  }
515334
@Override
    public boolean containsKey(Object key) {
        if (key == null) {
            throw new NullPointerException("Key can not be null");
        }
        if (!(key instanceof String)) {
            throw new ClassCastException("Only String keys are supported -- got " + key.getClass());
        }

        return get(key) != null;
    }
445434
static public function has($object, $key)
    {
        $oid = spl_object_hash($object);

        return isset(static::$archive[$oid]) && (isset(static::$archive[$oid][$key]) || array_key_exists($key, static::$archive[$oid]));
    }
1207955
public static boolean isAlreadyRegisteredIn(ObjectMapper mapper) {

		Assert.notNull(mapper, "ObjectMapper must not be null!");
		return LinkMixin.class.equals(mapper.findMixInClassFor(Link.class));
	}
600000
public boolean exists(String key) {
        Path dir = getKeyDir(key);
        boolean res = false;
        try {
            _fs = dir.getFileSystem(_hadoopConf);
            res = _fs.exists(dir);
        } catch (IOException e) {
            LOG.warn("Exception checking for exists on: " + key);
        }
        return res;
    }
1121621
static boolean isZipDirectory(Key key) {
    Iced ice = DKV.getGet(key);
    if (ice == null) throw new H2OIllegalArgumentException("Missing data", "Did not find any data under " +
            "key " + key);
    ByteVec bv = (ByteVec) (ice instanceof ByteVec ? ice : ((Frame) ice).vecs()[0]);

    return isZipDirectory(bv);
  }
905911
private boolean isJobSuccessful(String objectName) {
    LOG.trace("Checking if job completed successfull for {}", objectName);
    if (cachedSparkJobsStatus.containsKey(objectName)) {
      return cachedSparkJobsStatus.get(objectName).booleanValue();
    }
    final String obj = objectName;
    final Account account = mJossAccount.getAccount();
    LOG.trace("HEAD {}", obj + "/" + HADOOP_SUCCESS);
    final StoredObject so = account.getContainer(container).getObject(
            obj + "/" + HADOOP_SUCCESS
    );
    Boolean isJobOK = Boolean.FALSE;
    if (so.exists()) {
      LOG.debug("{} exists", obj + "/" + HADOOP_SUCCESS);
      isJobOK = Boolean.TRUE;
    }
    cachedSparkJobsStatus.put(objectName, isJobOK);
    return isJobOK.booleanValue();
  }
139103
public static boolean isDirectoryPlaceholder(String key, ObjectMetadata objectMetadata)
  {
    // Recognize "standard" directory place-holder indications used by
    // Amazon's AWS Console and Panic's Transmit.
    if (key.endsWith("/") && objectMetadata.getContentLength() == 0) {
      return true;
    }
    // Recognize s3sync.rb directory placeholders by MD5/ETag value.
    if ("d66759af42f282e1ba19144df2d405d0".equals(objectMetadata.getETag())) {
      return true;
    }
    // Recognize place-holder objects created by the Google Storage console
    // or S3 Organizer Firefox extension.
    if (key.endsWith("_$folder$") && objectMetadata.getContentLength() == 0) {
      return true;
    }

    // We don't use JetS3t APIs anymore, but the below check is still needed for backward compatibility.

    // Recognize legacy JetS3t directory place-holder objects, only gives
    // accurate results if an object's metadata is populated.
    if (objectMetadata.getContentLength() == 0 && MIMETYPE_JETS3T_DIRECTORY.equals(objectMetadata.getContentType())) {
      return true;
    }
    return false;
  }
221107
private boolean propertyExists(String key) {
        String value = getProperty(key);
        return (null != value && 0 < value.length());
    }
170075
public static boolean isLegalPropertyKey(String key)
  {

    return (key.equals(OutputKeys.CDATA_SECTION_ELEMENTS)
            || key.equals(OutputKeys.DOCTYPE_PUBLIC)
            || key.equals(OutputKeys.DOCTYPE_SYSTEM)
            || key.equals(OutputKeys.ENCODING)
            || key.equals(OutputKeys.INDENT)
            || key.equals(OutputKeys.MEDIA_TYPE)
            || key.equals(OutputKeys.METHOD)
            || key.equals(OutputKeys.OMIT_XML_DECLARATION)
            || key.equals(OutputKeys.STANDALONE)
            || key.equals(OutputKeys.VERSION)
            || (key.length() > 0) 
                  && (key.charAt(0) == '{') 
                  && (key.lastIndexOf('{') == 0)
                  && (key.indexOf('}') > 0)
                  && (key.lastIndexOf('}') == key.indexOf('}')));
  }
389602
@Override
	public boolean containsKey(final Object key) {
		lock.readLock().lock();
		try {
			if (isKeyValid(key)) {
				final boolean useLocalPrefixes = !mixDefaultAndLocalPrefixes && hasLocalPrefixConfigurations();
				if (!properties.containsKey(getPrefixedKey(key, useLocalPrefixes))) {
					return properties.containsKey(key);
				} else {
					return true;
				}
			}
			return false;
		} finally {
			lock.readLock().unlock();
		}
	}
1340819
private boolean _createDeltas(Serializable key)
    {
        if (isInitialStateMarked())
        {
            if (_copyFullInitialState && _initialFullState == null)
            {
                if (_initialState == null)
                {
                    // Copy it directly
                    _initialFullState = new HashMap<Serializable, Object>();
                    copyMap(_component.getFacesContext(), _fullState, _initialFullState);
                }
                else
                {
                    // Create only if the passed key is not part of the defined initial state
                    boolean keyInInitialState = false;
                    for (int i = 0; i < _initialState.length; i+=2)
                    {
                        Serializable key2 = (Serializable) _initialState[i];
                        if (key.equals(key2))
                        {
                            keyInInitialState = true;
                            break;
                        }
                    }
                    if (!keyInInitialState)
                    {
                        // Copy it directly, but note in this case if the initialFullState map
                        // contains some key already defined in initialState, this key must be
                        // overriden. It is better to do in that way, because it is possible
                        // to skip resetState() if the view cannot be recycled.
                        _initialFullState = new HashMap<Serializable, Object>();
                        copyMap(_component.getFacesContext(), _fullState, _initialFullState);
                        /*
                        for (int i = 0; i < _initialState.length; i+=2)
                        {
                            Serializable key2 = (Serializable) _initialState[i];
                            Object defaultValue = _initialState[i+1];
                            _initialFullState.put(key2, defaultValue);
                        }*/
                    }
                }
            }
            if (_deltas == null)
            {
                _deltas = new HashMap<Serializable, Object>(2);
            }
            return true;
        }

        return false;
    }
237081
@SuppressWarnings("unchecked")
  public boolean contains(final Object key) {
    // validate key
    if (key == null) {
      throw new IllegalArgumentException("Null element is not supported.");
    }
    // find element
    final int hashCode = ((T)key).hashCode();
    final int index = getIndex(hashCode);
    return containsElem(index, (T) key, hashCode);
  }
428210
public synchronized boolean containsKey(CacheKey key) {
    Preconditions.checkNotNull(key);
    if (!mMap.containsKey(key)) {
      return false;
    }
    EncodedImage storedEncodedImage = mMap.get(key);
    synchronized (storedEncodedImage) {
      if (!EncodedImage.isValid(storedEncodedImage)) {
        // Reference is not valid, this means that someone cleared reference while it was still in
        // use. Log error
        // TODO: 3697790
        mMap.remove(key);
        FLog.w(
            TAG,
            "Found closed reference %d for key %s (%d)",
            System.identityHashCode(storedEncodedImage),
            key.getUriString(),
            System.identityHashCode(key));
        return false;
      }
      return true;
    }
  }
771484
function (key) {
                var map = this._getMap(key, false);
                if (map == null) {
                    return false;
                }
                var item;
                if (map == this._objectKeys) {
                    item = key[this._metaDataName];
                } else if (map != this._otherKeys) {
                    item = map[key];
                } else {
                    for (var i in map) {
                        if (map.hasOwnProperty(i)) {
                            var elt = map[i];
                            if (key === elt.key) {
                                item = elt;
                                break;
                            }
                        }
                    }
                }
                if (item) {
                    return true;
                } else {
                    return false;
                }
            }