Creates the boolean value from the given String. If the given String does not match one of the 'true' value,
{@code false} is returned.

@param value the value
@return the boolean object
761568
@Override
    public Boolean fromString(String value) {
        return value != null && TRUE.contains(value.toLowerCase());
    }
1142666
function boolean(value) {
  var parsedBoolean = json(value);

  // handle 0|1 case
  if (typeOf(parsedBoolean) == 'number' && [0, 1].indexOf(parsedBoolean) > -1) {
    parsedBoolean = parsedBoolean === 0 ? false : true;
  }

  // couldn't parse it
  if (typeOf(parsedBoolean) != 'boolean') {
    return throwModifierError('boolean', value, {message: 'Invalid Boolean'});
  }

  return parsedBoolean;
}
958037
public boolean set(boolean value)
    {
        String prevValue = setString(Boolean.toString(value));
        if (prevValue == null) {
            prevValue = getDefaultValue();
            if (prevValue == null) {
                return false;
            }
        }
        return toBoolean(prevValue);
    }
969344
function encodeBool(value) {
    let buffer = new ByteBuffer();
    if (value === null) {
        return buffer;
    }
    if (typeof value === 'string') {
        return buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : Boolean(value));
    }
    return buffer.writeVarint32(value ? 1 : 0);
}
621286
public function Create( $value )
    {
		if ( is_bool( $value ) )
		{
			$value = $value ? CoreFuncs::$True : CoreFuncs::$False;
		}
		else if ( ! $value instanceof CoreFuncs::$True &&  ! $value instanceof CoreFuncs::$False )
		{
			$value = Convert::ToBoolean( $value, null );
		}
        return new BoolProxy( $value );
    }
365992
public boolean add(Boolean value) {
		if (value == null) {
			stateList.add(Type.NULL);
		} else {
			stateList.add(Type.BOOLEAN);
		}

		return super.add(value);
	}
273186
public void setControlValue(Object value)
    {
        Boolean boolValue = null;
        if (value instanceof String)    // Always
            if (((String)value).length() > 0)
                boolValue = new Boolean((String)value);
        if (boolValue == null)
            boolValue = Boolean.FALSE;
        this.setSelected(boolValue.booleanValue());
    }
1112873
public JSONObject element( String key, boolean value ) {
      verifyIsNull();
      return element( key, value ? Boolean.TRUE : Boolean.FALSE );
   }
314730
public static boolean isBooleanValue(final String value) {
        return Boolean.TRUE.toString().equalsIgnoreCase(value) || Boolean.FALSE.toString().equalsIgnoreCase(value);
    }
1123124
private static Boolean castToBoolean(Object val) //was BooleanValue
  {
    if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(cclass, "castToBoolean", val);
    Boolean theReturn = null;
    if (val instanceof String)
    {
      String stringVal = (String) val;
      if (stringVal.equalsIgnoreCase("true"))
        theReturn = Boolean.TRUE; // was BooleanValue.TRUE
      else
        if (stringVal.equalsIgnoreCase("false"))
          theReturn = Boolean.FALSE; // was BooleanValue.FALSE
    }
    if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(cclass, "castToBoolean", theReturn);    
    return theReturn;
  }
732985
protected Boolean coerceToBoolean(Value value) {
		if (!(value instanceof BooleanValue))
			throw new CommandExecutionException("Value is not a boolean");
		return ((BooleanValue) value).get();
	}
711463
public Boolean toBoolean(String self) {
		if (StrKit.isBlank(self)) {
			return null;	// return Boolean.FALSE;
		}
		
		String value = self.trim().toLowerCase();
		if ("true".equals(value) || "1".equals(value)) {	// 未来考虑 "yes"、"on"
			return Boolean.TRUE;
		} else if ("false".equals(value) || "0".equals(value)) {
			return Boolean.FALSE;
		} else {
			throw new RuntimeException("Can not parse to boolean type of value: \"" + self + "\"");
		}
	}
1338494
protected function getBoolFromStringBool($value)
    {
        if (!($value == 'true' || $value == 'false')) {
            $this->throwException(sprintf('Expected "true" or "false" but got %s', $value));
        }

        return $value === 'true' ? true : false;
    }
1143466
public void writeBoolean(boolean value) throws UnsupportedEncodingException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeBoolean", Boolean.valueOf(value));
    getBodyList().add(Boolean.valueOf(value));
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "writeBoolean");
  }
153421
private Boolean _convertToBoolean(Object value)
    {
        Boolean booleanValue;
        if (value instanceof Boolean)
        {
            booleanValue = (Boolean) value;
        }
        else
        {
            booleanValue = Boolean.parseBoolean(value.toString());
        }
        return booleanValue;
    }
1256576
public static Boolean toNullableBoolean(Object value) {
		if (value == null)
			return null;
		if (value instanceof Boolean)
			return (boolean) value;
		if (value instanceof Duration)
			return ((Duration) value).toMillis() > 0;

		String strValue = value.toString().toLowerCase();
		if (strValue.equals("1") || strValue.equals("true") || strValue.equals("t") || strValue.equals("yes")
				|| strValue.equals("y"))
			return true;

		if (strValue.equals("0") || strValue.equals("false") || strValue.equals("f") || strValue.equals("no")
				|| strValue.equals("n"))
			return false;

		return null;
	}
1115227
public static boolean valueOf(String value) {
        return (value != null) && (value.trim().equalsIgnoreCase("true") || value.trim().equals("1"));
    }