Create a boolean value from given string. Returns boolean true only if string is one of next constants: <em>true</em>,
<em>yes</em>, <em>1</em>, <em>on</em>; otherwise returns false. Note that comparison is not case sensitive.
551084
@Override
	public <T> T asObject(String string, Class<T> valueType) {
		// at this point value type is a boolean or a boxing boolean
		string = string.toLowerCase();
		if (string.equals("true")) {
			return (T) (Boolean) true;
		}
		if (string.equals("yes")) {
			return (T) (Boolean) true;
		}
		if (string.equals("1")) {
			return (T) (Boolean) true;
		}
		if (string.equals("on")) {
			return (T) (Boolean) true;
		}
		return (T) (Boolean) false;
	}
1115227
public static boolean valueOf(String value) {
        return (value != null) && (value.trim().equalsIgnoreCase("true") || value.trim().equals("1"));
    }
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;
	}
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;
}
469897
public BooleanExpression likeIgnoreCase(String str) {
        return Expressions.booleanOperation(Ops.LIKE_IC, mixin, ConstantImpl.create(str));
    }
976536
def _parse_boolean(value):
    
    value = value.lower()
    if value in _true_strings:
        return True
    elif value in _false_strings:
        return False
    else:
        return None
742838
def _to_boolean(string):
    

    if string == 'Y':
        result = True
    elif string == 'N':
        result = False
    else:
        raise pp.ParseException(string, msg='Is not a valid boolean value')

    return result
674857
public Boolean getAsBoolean() {
		if (value instanceof String) {
			return Boolean.parseBoolean((String)value);
		}
		return (Boolean)value;
	}
1292255
public static Boolean toBooleanObject(String str) {
		return str != null ? Boolean.valueOf(str) : null;
	}
38412
def _parse_boolean(value):
    
    if not value:
        return False

    try:
        # Lower string to check known "false" value
        value = value.lower()
        return value not in ("none", "0", "false", "no")
    except AttributeError:
        # Not a string, but has a value
        return True
789733
private boolean isTrue(final Object value) {

		if (value != null) {

			if (value instanceof Boolean) {

				return (Boolean)value;
			}

			if (value instanceof String) {

				return Boolean.valueOf((String)value);
			}

			// not sure if good..
			if (value instanceof Number) {

				return ((Number)value).longValue() > 0;
			}
		}

		return false;
	}
358471
def to_bool(value):
        """"""
        bool_value = False
        if str(value).lower() in ['1', 'true']:
            bool_value = True
        return bool_value
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);
    }
1327979
def boolean(value):
    
    if isinstance(value, bool):
        return value

    if value == "":
        return False

    return strtobool(value)
1284416
def to_bool(value):
    '''
    
    '''
    if isinstance(value, bool):
        return value
    elif isinstance(value, basestring):
        return value.lower() == 'true' or value.lower() == 't'
    elif isinstance(value, int):
        return value > 0
    else:
        return False
455777
def _fromstring(value):
        ''''''
        # NOTE: Is this even possible ?
        if value is None:
            return None

        # FIXME: In XML, booleans are either 0/false or 1/true (lower-case !)
        if value.lower() == 'true':
            return True
        elif value.lower() == 'false':
            return False

        # FIXME: Using int() or float() is eating whitespaces unintendedly here
        try:
            return int(value)
        except ValueError:
            pass

        try:
            # Test for infinity and NaN values
            if float('-inf') < float(value) < float('inf'):
                return float(value)
        except ValueError:
            pass

        return value
293657
private boolean parseBoolean(String s) {
        if ( "1".equals(s) ) {
            return true;
        } else if ( "0".equals(s) ) {
            return false;
        } else {
            throw new IllegalArgumentException("Expected 1 or 0 for boolean value, was " + s);
        }
    }