Compatibility implementation.

@param key
@return
420654
private ByteBuffer encodeAndAllocateBuffer(String key) {
        if (key == null) {
            return ByteBuffer.wrap(EMPTY);
        }

        CharsetEncoder encoder = CharsetUtil.encoder(charset);
        ByteBuffer buffer = ByteBuffer.allocate((int) (encoder.maxBytesPerChar() * key.length()));

        ByteBuf byteBuf = Unpooled.wrappedBuffer(buffer);
        byteBuf.clear();
        encode(key, byteBuf);
        buffer.limit(byteBuf.writerIndex());

        return buffer;
    }
875492
public LinkedList<Entry<String, V>> commonPrefixSearchWithValue(String key)
    {
        return commonPrefixSearchWithValue(key.toCharArray(), 0);
    }
1361338
@Override
  public ApiType getByKey(String key) {
    lock.lock();
    try {
      return this.items.get(key);
    } finally {
      lock.unlock();
    }
  }
168289
public boolean containsKey(String key, Charset charset)
    {
        return meta.containsKey(BinaryValue.unsafeCreate(key.getBytes(charset)));
    }
290863
public static LinkedList<Map.Entry<String, CoreDictionary.Attribute>> commonPrefixSearch(String key)
    {
        return trie.commonPrefixSearchWithValue(key);
    }
844140
public void containsKey(@NullableDecl Object key) {
    check("keySet()").that(actual().keySet()).contains(key);
  }
247048
@Override
  public Deque<MutablePair<DeltaType, Object>> getByKey(String key) {
    lock.readLock().lock();
    try {
      Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(key);
      if (deltas != null) {
        // returning a shallow copy
        return new LinkedList<>(deltas);
      }
    } finally {
      lock.readLock().unlock();
    }
    return null;
  }
680736
public T get(final int key) {
		int index = ((key & 0x7FFFFFFF) % elementKeys.length);

		long m = elementKeys[index];
		if (key == m) {
			return elementValues[index];
		}

		return null;
	}
1285827
public int addKey(String key) {
        JdkUtils.requireNonNull(key);
        int nextIndex = keys.size();
        final Integer mapIndex = JdkUtils.putIfAbsent(keys, key, nextIndex);
        return mapIndex == null ? nextIndex : mapIndex;
    }
925780
private Class<?> getKey(Class<?> key)
	{
		Class<?> newKey = lookupMap.get(key);
		if (newKey != null)
			return newKey;

		for (Class<?> c : internalMap.keySet())
		{
			if (c.isAssignableFrom(key))
			{
				lookupMap.put(key, c);
				return c;
			}
		}
		return null;
	}
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();
		}
	}
890625
public static ApiPlatform fromKeyToApiPlatform(int key) {
        if(keyToPlatform.get() == null) {
            Map<Integer, ApiPlatform> map = new HashMap<>();
            for (ApiPlatform apiPlatform : ApiPlatform.values()) {
                map.put(apiPlatform.getKey(), apiPlatform);
            }
            keyToPlatform.set(Collections.unmodifiableMap(map));
        }
        return keyToPlatform.get().get(key);
    }
541855
public boolean containsValues(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetValues().getMap().containsKey(key);
  }
1196837
@Override
  @Beta
  protected boolean standardContainsKey(@Nullable Object key) {
    try {
      // any CCE will be caught
      @SuppressWarnings("unchecked")
      SortedMap<Object, V> self = (SortedMap<Object, V>) this;
      Object ceilingKey = self.tailMap(key).firstKey();
      return unsafeCompare(ceilingKey, key) == 0;
    } catch (ClassCastException e) {
      return false;
    } catch (NoSuchElementException e) {
      return false;
    } catch (NullPointerException e) {
      return false;
    }
  }
955053
private String processKey(String key) {
        AssertUtils.assertNotNull(key, "Key cannot be null");

        String result = null;

        if (this.isCaseSensitive() == false) {
            result = key.toLowerCase(Locale.ENGLISH);
        } else {
            result = key;
        }

        return result;
    }
180113
public boolean compatible( PropertySet properties)
    {
    boolean isCompatible;
    Iterator<ICondition> conditions;
    
    for( conditions = getConditions(),
           isCompatible = !conditions.hasNext();

         !isCompatible
           && conditions.hasNext();

         isCompatible = conditions.next().compatible( properties));
    
    return isCompatible;
    }
1073362
public synchronized void add(GenericKeys key) {
        KeyBucket bucket = makeBucket(key.getName().charAt(0));
        if (null != bucket) {
            bucket.add(key);
        }
    }