Called by sliced fetch to ensure that arguments are valid.

@return false if from is 0 and to is null
@throws IllegalArgumentException if arguments are invalid
@since 1.2
519974
protected boolean checkSliceArguments(long from, Long to) {
        if (from < 0) {
            throw new IllegalArgumentException("Slice from is negative: " + from);
        }
        if (to == null) {
            if (from == 0) {
                return false;
            }
        } else if (from > to) {
            throw new IllegalArgumentException
                ("Slice from is more than to: " + from + " > " + to);
        }
        return true;
    }
618733
public boolean isValid(int expectedRequestCode) {
        Uri uri = intent != null ? intent.getData() : null;
        if (uri == null) {
            Log.d(TAG, "Result is invalid: Received Intent's Uri is null.");
            return false;
        }

        if (requestCode == MISSING_REQUEST_CODE) {
            return true;
        }

        boolean fromRequest = getRequestCode() == expectedRequestCode;
        if (!fromRequest) {
            Log.d(TAG, String.format("Result is invalid: Received Request Code doesn't match the expected one. Was %d but expected %d", getRequestCode(), expectedRequestCode));
        }
        return fromRequest && resultCode == Activity.RESULT_OK;
    }
893495
public static boolean checkArgs(String[] args) {
	if (args.length < 5) {
	    return false;
	}
	
	if (!(args[0].compareToIgnoreCase("-all") == 0 ||
		    args[0].compareToIgnoreCase("-trn") == 0 ||
		    args[0].compareToIgnoreCase("-tst") == 0) || 
		    args[0].compareToIgnoreCase("-cont") == 0) {
	    return false;
	}
	
	if (args[1].compareToIgnoreCase("-d") != 0) {
	    return false;
	}
	
	if (args[3].compareToIgnoreCase("-o") != 0)
		return false; 
	
	return true;
    }
889934
private static void checkArguments(final Object... args) {
        for (Object o : args) {
            if (o == null) {
                throw new NullPointerException("argument can not be null " + Arrays.toString(args));
            }
        }
    }
680299
def is_valid(cls, arg):
        
        return (isinstance(arg, (int, long)) and (arg >= 0)) or \
            isinstance(arg, str)
494922
private static boolean validParameter(final Parameter p) {
        if (p.getNamespace() == null) {
            return false;
        }
        if (p.getValue() == null) {
            return false;
        }
        return true;
    }
629274
public function noMoreDefinedArguments()
    {
        $definedArguments = array_filter($this->arguments, function ($argument) {
            return !is_null($argument);
        });

        if ($count = count($definedArguments)) {
            throw new InvalidArgumentException('You pass '.$count.' unexpected not null arguments');
        }
    }
66053
public static void isNotEmpty( Collection<?> argument,
                                   String name ) {
        isNotNull(argument, name);
        if (argument.isEmpty()) {
            throw new IllegalArgumentException(CommonI18n.argumentMayNotBeEmpty.text(name));
        }
    }
197755
@Override
    public void isValid() throws Exception {
        if (numStmnts() >= 2) {
            if (primaryJoinableHooks.size() > 0) {
                for (String joinField:primaryJoinableHooks) {
                    if (joinField.equals("timestamp")) {// timestamp is implicitly present in the result.
                        continue;
                    }
                    for (QueryMeta query: getAllStmnts()) {
                        boolean isPresent = false;
                        if (query instanceof BaseAggQueryMeta) {// Since BaseAggQueryMeta is also a PlainDimQueryMeta we go with former first.
                            for (AggItem item:((BaseAggQueryMeta)query).aggregations) {
                                if (joinField.equals(item.fieldName) || (item.asName != null && joinField.equals(item.asName))) {
                                    isPresent = true;
                                }
                            }
                        }
                        if (query instanceof PlainDimQueryMeta) {
                            Map<String, String> dims = ((PlainDimQueryMeta)query).fetchDimensions;
                            for (Map.Entry<String, String> entry :dims.entrySet()) {
                                if (joinField.equals(entry.getKey()) || (entry.getValue() != null && joinField.equals(entry.getValue()))) {
                                    isPresent = true;
                                }
                            }
                        }
                        if (!isPresent) {
                            String error = joinField + " mentioned in the composite key should appear in all the data sources being queried and joined.";
                            throw new Exception(error);
                        }
                    }
                }
            } else {
                String error = "Need atleast one field to join on";
                throw new Exception(error);
            }
        }
    }
520007
@Override
	public boolean isValid() {
		boolean mustNotCache =
				has("Pragma", "no-cache", this.response)
				|| has("Cache-Control", "no-cache", this.response);

		if (mustNotCache)
			return false;

		Date now = new Date();
		Date cacheControl = getCacheControlExpiresDate();
		Date expires = getExpiresDate();

		return now.before(cacheControl) || now.before(expires);
	}
1184315
@Override
    public T parse(String arg) throws ParseException {
        if (isNull(arg)) {
            if (nullable) {
                return null;
            } else {
                throw new ParseException(ParseError.INVALID_PARAM, "Parameter doesn't take 'null' values: " + getName());
            }
        }
        return parseNonNull(arg);
    }
584159
protected boolean isStoreValid() {
        boolean result = false;
        String requestURI = this.request.getUri();
        this.storeName = parseStoreName(requestURI);
        if(storeName != null) {
            result = true;
        } else {
            logger.error("Error when validating request. Missing store name.");
            RestErrorHandler.writeErrorResponse(this.messageEvent,
                                                HttpResponseStatus.BAD_REQUEST,
                                                "Missing store name. Critical error.");
        }
        return result;
    }
44644
private void validateInput() {
        // Check for null values first.
        if (url == null) {
            throw new NullPointerException("URL should not be null");
        }
        if (!url.getProtocol().matches("^https?$")) {
            throw new IllegalArgumentException(
                    "URL protocol should be HTTP or HTTPS");
        }
        if (url.getRef() != null) {
            throw new IllegalArgumentException(
                    "URL should contain no reference");
        }
        if (url.getQuery() != null) {
            throw new IllegalArgumentException(
                    "URL should contain no query string");
        }
        if (handler == null) {
            throw new NullPointerException(
                    "Callback handler should not be null");
        }
    }
512548
public static boolean isValidArg(String arg) {
    final String[] args = arg.split(":");
    if (args.length != 2) {
      return false;
    }

    final String ip = args[1];
    return InetAddresses.isInetAddress(ip);
  }
1067731
@JsonIgnore
    public boolean isValid() {
        return StringUtils.isNotBlank(getMetadata())
            && StringUtils.isNotBlank(getSigningCertificate())
            && StringUtils.isNotBlank(getSigningKey())
            && StringUtils.isNotBlank(getEncryptionCertificate())
            && StringUtils.isNotBlank(getEncryptionKey());
    }
969593
private boolean toBoundedLast() throws FetchException {
        if (mEndBound == null) {
            if (!toLast()) {
                return false;
            }
        } else {
            if (!toLast(mEndBound.clone())) {
                return false;
            }
            if (!mInclusiveEnd) {
                byte[] currentKey = getCurrentKey();
                if (currentKey == null) {
                    return false;
                }
                if (compareKeysPartially(mEndBound, currentKey) == 0) {
                    if (!toPreviousKey()) {
                        return false;
                    }
                }
            }
        }

        if (mStartBound != null) {
            byte[] currentKey = getCurrentKey();
            if (currentKey == null) {
                return false;
            }
            int result = compareKeysPartially(currentKey, mStartBound);
            if (result <= 0) {
                if (result < 0 || !mInclusiveStart) {
                    return false;
                }
            }
        }

        return prefixMatches();
    }
94375
static void checkArgument(boolean check, String msg, Object... args) {
    if (!check) {
      throw new IllegalArgumentException(String.format(msg, args));
    }
  }