Check if some keys are present.

@param o    the object to parse
@param keys the keys to check
@throws JSONConverterException when at least a key is missing
514955
public static void checkKeys(JSONObject o, String... keys) throws JSONConverterException {
        for (String k : keys) {
            if (!o.containsKey(k)) {
                throw new JSONConverterException("Missing key '" + k + "'");
            }
        }
    }
1083528
public static VM requiredVM(Model mo, JSONObject o, String id) throws JSONConverterException {
        checkKeys(o, id);
        try {
            return getVM(mo, (Integer) o.get(id));
        } catch (ClassCastException e) {
            throw new JSONConverterException("Unable to read a VM identifier from string at key '" + id + "'", e);
        }
    }
1170789
public <S, T> T convertTo(ConverterKey<S,T> key, Object object) {

		if (object == null) {
			return null;
		}
		
		Converter<S, T> conv = findConverter(key.getInputClass(), key.getOutputClass(), key.getQualifierAnnotation() == null ? DefaultBinding.class : key.getQualifierAnnotation());
		
		if (conv == null) {
			throw new NoConverterFoundException(key);
		}
		
		@SuppressWarnings("unchecked")
		S myObject = (S)object;
		return conv.convert(myObject);
	}
634940
@SuppressWarnings("rawtypes")
	public List mget(Object... keys) {
		Jedis jedis = getJedis();
		try {
			byte[][] keysBytesArray = keysToBytesArray(keys);
			List<byte[]> data = jedis.mget(keysBytesArray);
			return valueListFromBytesList(data);
		}
		finally {close(jedis);}
	}
1184165
public RequestLimitRule matchingKeys(String... keys) {
        Set<String> keySet = keys.length > 0 ? new HashSet<>(Arrays.asList(keys)) : null;
        return matchingKeys(keySet);
    }
910966
public void setKeys(java.util.Collection<Key> keys) {
        if (keys == null) {
            this.keys = null;
            return;
        }

        java.util.List<Key> keysCopy = new java.util.ArrayList<Key>(keys.size());
        keysCopy.addAll(keys);
        this.keys = keysCopy;
    }
382867
@Override
    public final boolean has(final String key) {
        String result = this.obj.optString(key, null);
        return result != null;
    }
149802
public void setKeys(java.util.Collection<java.util.Map<String, AttributeValue>> keys) {
        if (keys == null) {
            this.keys = null;
            return;
        }

        this.keys = new java.util.ArrayList<java.util.Map<String, AttributeValue>>(keys);
    }
879606
public boolean matchKey (final String key) {
        if (key == null) return false;
        for (int i = 0; i < values.length; ++i)
            if (values[i].equals(key)) return true;
        return false;
    }
561108
private static void checkArguments(JSONObject jsonObject, String key) throws JSONException {
		if (key == null) {
			throw new IllegalArgumentException("Can't go searching for a null key.");
		}
		if (jsonObject == null) {
			throw new JSONException("Can't search for key '" + key + "' in a null object.");
		}
		if (!jsonObject.containsKey(key)) {
			throw new JSONException("Key '" + key + "' could not be found.");
		}
		// Please, proceed...
	}
1085007
public void pressKey(final Keys keys) {
        if (keys == null) return;

        runWithRetries(() -> {
            elementImpl.locateElement().sendKeys(keys);
        });
    }
770169
public JSONObject optJSONObject( String key ) {
      verifyIsNull();
      Object o = opt( key );
      return o instanceof JSONObject ? (JSONObject) o : null;
   }
119834
public static int requiredInt(JSONObject o, String id) throws JSONConverterException {
        checkKeys(o, id);
        try {
            return (Integer) o.get(id);
        } catch (ClassCastException e) {
            throw new JSONConverterException("Unable to read a int from string '" + id + "'", e);
        }
    }
329908
@Override
    public <O> void set(String key, O value) {
        set(key,value,null,false);
    }
1369060
static public void put(String key, Object o) {
        if (setContext()) {
            m_context.put(key, o);
        } else {
            m_defaultContext.put(key, o);
        }
    }
865755
public boolean containsKeys(Collection<K> keys) {
        for(K key: keys)
            if(!map.containsKey(key))
                return false;
        return true;
    }
650713
public JSONObject getJSONObject( String key ) {
      verifyIsNull();
      Object o = get( key );
      if( JSONNull.getInstance()
            .equals( o ) ){
         return new JSONObject( true );
      }else if( o instanceof JSONObject ){
         return (JSONObject) o;
      }
      throw new JSONException( "JSONObject[" + JSONUtils.quote( key ) + "] is not a JSONObject." );
   }