Validates the metric
@throws IllegalArgumentException if one or more parameters were invalid
349721
public void validate() {
    if (metric == null || metric.isEmpty()) {
      throw new IllegalArgumentException("missing or empty metric");
    }

    if (id == null || id.isEmpty()) {
      throw new IllegalArgumentException("missing or empty id");
    }
    Query.validateId(id);

    if (time_offset != null) {
      DateTime.parseDateTimeString(time_offset, null);
    }
    
    if (aggregator != null && !aggregator.isEmpty()) {
      try {
        Aggregators.get(aggregator.toLowerCase());
      } catch (final NoSuchElementException e) {
        throw new IllegalArgumentException("Invalid aggregator");
      }
    }

    if (fill_policy != null) {
      fill_policy.validate();
    }
  }
507907
public void validate() {
    if (start == null || start.isEmpty()) {
      throw new IllegalArgumentException("missing or empty start");
    }
    DateTime.parseDateTimeString(start, timezone);
    
    if (end != null && !end.isEmpty()) {
      DateTime.parseDateTimeString(end, timezone);
    }
    
    if (downsampler != null) {
      downsampler.validate();
    }
    
    if (aggregator == null || aggregator.isEmpty()) {
      throw new IllegalArgumentException("Missing or empty aggregator");
    }
    
    try {
      Aggregators.get(aggregator.toLowerCase());
    } catch (final NoSuchElementException e) {
      throw new IllegalArgumentException("Invalid aggregator");
    }
  }
1154003
public function validate()
    {
        if (!$this->translatable) {
            throw new MappingException(sprintf('No translatable specified for %s', $this->name));
        }

        if (!$this->targetEntity) {
            throw new MappingException(sprintf('No translatable targetEntity specified for %s', $this->name));
        }

        if (!$this->locale) {
            throw new MappingException(sprintf('No locale specified for %s', $this->name));
        }
    }
404471
public boolean validate(final List<Map<String, Object>> details) {
    if (this.getMetric() == null || this.getMetric().isEmpty()) {
      if (details != null) {
        details.add(getHttpDetails("Metric name was empty"));
      }
      LOG.warn("Metric name was empty: " + this);
      return false;
    }

    //TODO add blacklisted metric validatin here too
    
    if (this.getTimestamp() <= 0) {
      if (details != null) {
        details.add(getHttpDetails("Invalid timestamp"));
      }
      LOG.warn("Invalid timestamp: " + this);
      return false;
    }

    if (this.getValue() == null || this.getValue().isEmpty()) {
      if (details != null) {
        details.add(getHttpDetails("Empty value"));
      }
      LOG.warn("Empty value: " + this);
      return false;
    }

    if (this.getTags() == null || this.getTags().size() < 1) {
      if (details != null) {
        details.add(getHttpDetails("Missing tags"));
      }
      LOG.warn("Missing tags: " + this);
      return false;
    }
    return true;
  }
1334637
protected void validatePattern() {
        if (pattern.length() == 0) {
            throw new IllegalArgumentException(Tr.formatMessage(tc, "OPENTRACING_FILTER_PATTERN_BLANK"));
        }

        if (!regex) {
            try {
                URI.create(pattern);
            } catch (IllegalArgumentException e) {
                throw new IllegalArgumentException(Tr.formatMessage(tc, "OPENTRACING_FILTER_PATTERN_INVALID", pattern), e);
            }
        }
    }
29864
@Override
	public void validate() throws AddressStringException {
		if(isValidated()) {
			return;
		}
		synchronized(this) {
			if(isValidated()) {
				return;
			}
			//we know nothing about this address.  See what it is.
			try {
				parsedAddress = getValidator().validateAddress(this);
				isValid = true;
			} catch(AddressStringException e) {
				cachedException = e;
				isValid = false;
				throw e;
			}
		}
	}
1319871
public void validateElementTag() {

		String errorMsg = String.format(
				ErrorMessages.ERROR_INVALID_TAG_TO_CLASS, getElement()
						.getTagName());

		if (!isValidElementTag()) {
			throw new IllegalArgumentException(errorMsg);
		}
	}
544225
@Override
    public <T extends Metric> T register(String name, T metric) throws IllegalArgumentException {
        // For MP Metrics 1.0, MetricType.from(Class in) does not support lambdas or proxy classes
        return register(name, metric, new Metadata(name, from(metric)));
    }
447293
public void assertValid(String valueAsString) throws IllegalArgumentException {
		final T value = valueConverter.convert(valueAsString);
		for (Validator<T> validator : validators) {
			validator.assertValid(value);
		}
	}
698558
def check_metric(self, metric):
        """"""
        if metric not in self.VALID_METRICS:
            raise ValueError(
                f"`{self.__class__.__name__}` does not support the `{metric}` "
                f"metric. Please choose one of the supported metrics: "
                f"{', '.join(self.VALID_METRICS)}."
            )
966680
private void validate() {
        if (isDense() && isPattern())
            throw new IllegalArgumentException(
                    "Matrix cannot be dense with pattern storage");
        if (isReal() && isHermitian())
            throw new IllegalArgumentException(
                    "Data cannot be real with hermitian symmetry");
        if (!isComplex() && isHermitian())
            throw new IllegalArgumentException(
                    "Data must be complex with hermitian symmetry");
        if (isPattern() && isSkewSymmetric())
            throw new IllegalArgumentException(
                    "Storage cannot be pattern and skew symmetrical");
    }
1153587
private static void validateSetting(ConfigurationSetting setting) {
        Objects.requireNonNull(setting);

        if (setting.key() == null) {
            throw new IllegalArgumentException("Parameter 'key' is required and cannot be null.");
        }
    }
321344
static void checkMetricAndTags(final String metric,
      final Map<String, String> tags) {
    if (tags.size() <= 0) {
      throw new IllegalArgumentException("Need at least one tag (metric="
          + metric + ", tags=" + tags + ')');
    } else if (tags.size() > Const.MAX_NUM_TAGS()) {
      throw new IllegalArgumentException("Too many tags: " + tags.size()
          + " maximum allowed: " + Const.MAX_NUM_TAGS() + ", tags: " + tags);
    }

    Tags.validateString("metric name", metric);
    for (final Map.Entry<String, String> tag : tags.entrySet()) {
      Tags.validateString("tag name with value [" + tag.getValue() + "]", 
          tag.getKey());
      Tags.validateString("tag value with key [" + tag.getKey() + "]", 
          tag.getValue());
    }
  }
1092594
public static function validateConstructorArgs($name, $globalThreshold, $metric,
                                                 $metricFactor, $componentThreshold,
                                                 $components, $validMetrics)
  {
    if (!self::validateName($name))
      throw new \Franzip\Throttler\Exceptions\InvalidArgumentException('Invalid Throttler $name: please supply a valid non-empty string.');

    if (!self::validateGlobalThreshold($globalThreshold))
      throw new \Franzip\Throttler\Exceptions\InvalidArgumentException('Invalid Throttler $globalThreshold: please supply a positive integer.');

    if (!self::validateMetric($metric, $validMetrics))
      throw new \Franzip\Throttler\Exceptions\InvalidArgumentException('Invalid Throttler $metric. Valid choices are "sec", "min", "hrs".');

    if (!self::validateMetricFactor($metricFactor))
      throw new \Franzip\Throttler\Exceptions\InvalidArgumentException('Invalid Throttler $metricFactor: please supply a positive integer.');

    if (!self::validateComponentThreshold($componentThreshold))
      throw new \Franzip\Throttler\Exceptions\InvalidArgumentException('Invalid Throttler $componentThreshold: please supply a positive integer or null.');

    if (!self::compareThresholds($componentThreshold, $globalThreshold))
      throw new \Franzip\Throttler\Exceptions\InvalidArgumentException('Invalid Throttler $componentThreshold: $componentThreshold must be lower than $globalThreshold.');

    if (!self::validateComponents($components))
      throw new \Franzip\Throttler\Exceptions\InvalidArgumentException('Invalid Throttler $components: $components must be an array.');

    if (!self::validateComponentsName($components))
      throw new \Franzip\Throttler\Exceptions\InvalidArgumentException('Invalid Throttler $components: $components entries must be non empty strings.');
    }
578073
public static final void validateToken(AuthToken token) throws IllegalArgumentException {
        if (token.getExpiresOn().before(new Date())) {
            throw new IllegalArgumentException("Authentication token expired: " + token.getExpiresOn()); //$NON-NLS-1$
        }
        String validSig = generateSignature(token);
        if (token.getSignature() == null || !token.getSignature().equals(validSig)) {
            throw new IllegalArgumentException("Missing or invalid signature on the auth token."); //$NON-NLS-1$
        }
    }
464911
public function validate()
    {
        foreach (func_get_args() as $key) {
            $value = $this->parameters->get($key);
            if (empty($value) && $value !== '0' && $value !== false) {
                throw new InvalidRequestException("The $key parameter is required");
            }
        }
    }
1130393
public static void checkArgument(boolean b, String errorMessageTemplate, double p) {
        if (!b) {
            throw new IllegalArgumentException(format(errorMessageTemplate, p));
        }
    }