Validate a key and array of values.

@param key The configuration key.
@param values The array of string values.
338919
function validate(key, values) {
  var typedef, value;

  if(!~Keys.indexOf(key)) {
    throw new Error('unknown configuration key: ' + key);
  }

  // retrieve the type definition
  typedef = Types[key];

  // validate on the typedef
  try {
    value = typedef.validate(key, values);
  }catch(e) {
    // got a more specific error message to throw
    if(typeof validator[key] === 'object'
      && validator[key].error) {
      throw validator[key].error;
    }
    throw e;
  }

  return value;
}
513917
public static void set(PropertyKey key, Object value) {
    set(key, String.valueOf(value), Source.RUNTIME);
  }
969689
public static void validateAllOrNone(Props props, String... keys) {
    Objects.requireNonNull(keys);

    boolean allExist = true;
    boolean someExist = false;
    for (String key : keys) {
      Object val = props.get(key);
      allExist &= val != null;
      someExist |= val != null;
    }

    if (someExist && !allExist) {
      throw new IllegalArgumentException(
          "Either all of properties exist or none of them should exist for " + Arrays
              .toString(keys));
    }
  }
477095
private static boolean validateKey(String key) {
    if (key.length() > KEY_MAX_SIZE
        || key.isEmpty()
        || key.charAt(0) < 'a'
        || key.charAt(0) > 'z') {
      return false;
    }
    for (int i = 1; i < key.length(); i++) {
      char c = key.charAt(i);
      if (!(c >= 'a' && c <= 'z')
          && !(c >= '0' && c <= '9')
          && c != '_'
          && c != '-'
          && c != '*'
          && c != '/') {
        return false;
      }
    }
    return true;
  }
494160
public void validateAttribute(final String key, final String value) throws Exception {
        for (ITenantOperationsListener listener : tenantOperationsListeners) {
            // Will throw an exception if not valid
            listener.validateAttribute(key, value);
        }
    }
938718
public void put(K key, V value) {
        final int hash = key.hashCode();
        final int row = hash / SIZE_ROW;
        final int column = hash & (SIZE_ROW - 1); // DON'T use the % operator as we
                                                  // need the result to be
                                                  // non-negative (-1%16 is -1 for
                                                  // example)
        validateKey(hash);
        validateTable(row);
        this.values[row][column] = value;
        this.keys[hash] = key;
    }
791169
public boolean hasTag(String key, String... values) {
        Object value = properties.get(key);
        if (value == null)
            return false;

        // tag present, no values given: success
        if (values.length == 0)
            return true;

        for (String val : values) {
            if (val.equals(value))
                return true;
        }
        return false;
    }
10406
private static void checkValueInPossibilities(Object val, IConfigKey configKey) {
		if (val != null && configKey.getPossibleValues() != null && !configKey.getPossibleValues().contains(val)) {
			throw new RuntimeException(String.format("Invalid value for key=[%s], possibles=%s",
				configKey.getKey(), configKey.getPossibleValues()));
		}
	}
733699
def validate(self, key, value):
    """"""
    if self._validator is not None:
      self._validator(key, value)
1264470
public void removeKey(String key) {
        if (key != null && !key.isEmpty()) {
            for (int i=0; i<map.size(); i++) {
                KeyValue kv = map.get(i);
                if (key.equals(kv.getKey())) {
                    map.remove(i);
                    return;
                }
            }
        }
    }
710796
public void setInput(String key, String value) {
        if (getAllowedKeys() != null && !getAllowedKeys().contains(key))
            throw new IllegalStateException("The input key " + key + " is not allowed for lookups");

        _inputs.put(key, value);
    }
156385
function validate(key) {
        var type = getType(key);
        if (type === "array") {
            for (var i = 0; i < key.length; i++) {
                validate(key[i]);
            }
        }
        else if (!types[type] || (type !== "string" && isNaN(key))) {
            throw idbModules.util.createDOMException("DataError", "Not a valid key");
        }
    }
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;
    }
1108595
public boolean isValidSignature(final Key key) {
        final byte[] computedHmac = key.sign(getVersion(), getTimestamp(), getInitializationVector(),
                getCipherText());
        return Arrays.equals(getHmac(), computedHmac);
    }
466004
public void addValueList(String key, String value) {
        Objects.requireNonNull(key, Required.KEY.toString());

        if (!valueMap.containsKey(key)) {
            List<String> values = new ArrayList<>();
            values.add(value);
            
            valueMap.put(key, values);
        } else {
            List<String> values = valueMap.get(key);
            values.add(value);
            
            valueMap.put(key, values);
        }
    }
1076162
public static void addValues(String key, Collection<String> values, MultiValueMap<String, String> params) {
        if (values != null) {
            for (String value : values) {
                params.add(key, value);
            }
        }
    }
1293047
private static void setValue(Map<String,String> map, String key, String value) {
		map.put(key,value);
	}