Validates a given value to be true

@param value The value to check
@param name The name of the field to display the error message
321067
public void validateTrue(boolean value, String name) {
        validateTrue(value, name, messages.get(Validation.TRUE_KEY.name(), name));
    }
1101289
@Override
	public boolean validate(Object value) {
		if(constraints == null) {
			return false;
		}

		IConstraintChecker checker;
		for(BeanProperty constraint : constraints) {
			checker = checkers.get(constraint.getPropertyName());
			if(checker == null) {
				throw new RuntimeException("No checker found for constraint "
						+ "'" + constraint.getPropertyName() + "'"
				);
			}
			checker.check(value, constraint);
		}
		return true;
	}
337690
protected function validate($name, $value)
    {
        if (isset($this->properties[$name]) === false ||
            isset($this->properties[$name]['type']) === false) {
            throw new Exception('Invalid property "' . $name . '"');
        }

        try {
            $value = Validate::property($this->properties[$name], $value);
        } catch (Exception $e) {
            throw new Exception('Invalid value for property "' . $name . '" (' . $e->getMessage() . ')');
        }

        return $value;
    }
944833
public void validateTrue(boolean value, String name, String message) {
        if (!value) {
            addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.TRUE_KEY.name(), name)));
        }
    }
947160
static void validateHeaderValue(CharSequence value) {
        if (value == null) {
            throw new NullPointerException("value");
        }
        for (int i = 0; i < value.length(); i ++) {
            char c = value.charAt(i);
            if (c == 0) {
                throw new IllegalArgumentException(
                        "value contains null character: " + value);
            }
        }
    }
1112928
function(value, name) {

		var result = false,
			index = this._data_values.indexOf(value);

		if (index == -1) {
			this.push(value, name);
			result = true;
		}

		return result;

	}
1033391
public final void verifyNameValidity(String name, boolean checkNs)
        throws XMLStreamException
    {
        /* No empty names... caller must have dealt with optional arguments
         * prior to calling this method
         */
        if (name == null || name.length() == 0) {
            reportNwfName(ErrorConsts.WERR_NAME_EMPTY);
        }
        int illegalIx = WstxInputData.findIllegalNameChar(name, checkNs, mXml11);
        if (illegalIx >= 0) {
            if (illegalIx == 0) {
                reportNwfName(ErrorConsts.WERR_NAME_ILLEGAL_FIRST_CHAR,
                              WstxInputData.getCharDesc(name.charAt(0)));
            }
            reportNwfName(ErrorConsts.WERR_NAME_ILLEGAL_CHAR,
                          WstxInputData.getCharDesc(name.charAt(illegalIx)));
        }
    }
377278
public FunctionInputDefBuilder has( String name, Object value)
    {
    functionInputDef_.setAnnotation( name, Objects.toString( value, null));
    return this;
    }
593376
public static void validateName(String name) throws InvalidNameException {
        if (StringUtils.isEmpty(name)) {
            throw ExceptionFactory.invalidNameException(Messages.i18n.format("FieldValidator.EmptyNameError")); //$NON-NLS-1$
        }
    }
121162
private static boolean isValid(String name) {
    return !name.isEmpty() && name.length() <= MAX_LENGTH && StringUtils.isPrintableString(name);
  }
383472
@NonNull
    public Parameters setBoolean(@NonNull String name, boolean value) {
        return setValue(name, value);
    }
654220
private void checkForBlank(String value, String name) {
        if (StringUtils.isBlank(value)) {
            throw new IllegalArgumentException(name + " cannot be empty");
        }
    }
332654
protected function _validate($name, $value)
	{
 		switch ($name)
		{
			case 'offset':
			case 'total_items':
				// make sure it's an integer
				if ($value != intval($value))
				{
					$value = 0;
				}
				// and that it's within bounds
				$value = max(0, $value);
			break;

			// integer or string
			case 'uri_segment':
				if (is_numeric($value))
				{
					// make sure it's an integer
					if ($value != intval($value))
					{
						$value = 1;
					}
					// and that it's within bounds
					$value = max(1, $value);
				}
			break;

			// validate integer values
			case 'current_page':
			case 'per_page':
			case 'limit':
			case 'total_pages':
			case 'num_links':
				// make sure it's an integer
				if ($value != intval($value))
				{
					$value = 1;
				}
				// and that it's within bounds
				$value = max(1, $value);
			break;

			// validate booleans
			case 'show_first':
			case 'show_last':
				if ( ! is_bool($value))
				{
					$value = (bool) $value;
				}
			break;

			// validate the link offset, and adjust if needed
			case 'link_offset':
				// make sure we have a fraction between 0 and 1
				if ($value > 1)
				{
					$value = $value / 100;
				}

				// and that it's within bounds
				$value = max(0.01, min($value, 0.99));
			break;
		}

		return $value;
	}
926103
public static void requireArgValid(@NotNull final String name, @NotNull final File value) throws ConstraintViolationException {
        // CHECKSTYLE:ON
        if (!value.exists()) {
            throw new ConstraintViolationException("The argument '" + name + "' is not an existing file: '" + value + "'");
        }
    }
438862
protected void addValidValue(String value)
	{
		if(value!=null && !value.isEmpty())
			validValues.add(value.toLowerCase());
	}
911722
public void addField(final String name, final Object value) {
        if (value == null) {
            this.fields.add(new Field(name, null, null));
        } else {
            this.fields.add(new Field(name, value.toString(), value.getClass().getName()));
        }
    }
796251
public static void validateStringValue(String value) throws ParameterException {
		Validate.notNull(value);
		Validate.notEmpty(value);
	}