Set a new boolean attribute, remove attribute if value is false.
@param key case <b>insensitive</b> attribute key
@param value attribute value
@return these attributes, for chaining
765773
public Attributes put(String key, boolean value) {
        if (value)
            putIgnoreCase(key, null);
        else
            remove(key);
        return this;
    }
511873
public void setValue(String key, String value) {
        KeyValue kv = getKV(key);
        if (kv != null) {
            kv.setValue(value);
        } else if (key != null) {
            map.add(new KeyValue(key,value));
        }
    }
408346
public static final Boolean parseExtendedAttributeBoolean(String value)
   {
      return ((value.equals("1") ? Boolean.TRUE : Boolean.FALSE));
   }
153421
private Boolean _convertToBoolean(Object value)
    {
        Boolean booleanValue;
        if (value instanceof Boolean)
        {
            booleanValue = (Boolean) value;
        }
        else
        {
            booleanValue = Boolean.parseBoolean(value.toString());
        }
        return booleanValue;
    }
161056
public function addAttribute($key, $value = true)
    {
        if ($value === null) {
            return $this;
        }
        $this->attributes[$key] = $value;

        return $this;
    }
307063
@Override
    public void setAttribute(String key, Object value) {
        if (value == null) {
            setAttribute(key, null);
        } else {
            setAttribute(key, Collections.singletonList(value));
        }
    }
314730
public static boolean isBooleanValue(final String value) {
        return Boolean.TRUE.toString().equalsIgnoreCase(value) || Boolean.FALSE.toString().equalsIgnoreCase(value);
    }
303672
public <T> B attr(AttributeKey<T> key, T value) {
        if (key == null) {
            throw new NullPointerException("key");
        }
        if (value == null) {
            synchronized (attrs) {
                attrs.remove(key);
            }
        } else {
            synchronized (attrs) {
                attrs.put(key, value);
            }
        }
        return self();
    }
295790
function(attr, options) {
    options = options ? _.clone(options) : {};
    var val = this.get(attr);
    if(!_.isBoolean(val)) console.error('Tried to toggle non-boolean value ' + attr +'!', this);
    return this.set(attr, !val, options);
  }
1300379
public void setBooleanProperty( String key , boolean value )
    {
        settings.setProperty(key, String.valueOf(value));
    }
1368217
public function setAttribute($key, $value = null)
    {
        if (is_array($key) && is_null($value)) {
            $this->attributes = $key;
        } else {
            array_set($this->attributes, $key, $value);
        }

        return $this;
    }
882197
@Override
    public void set(String key, String value) {
    	if("dn".equals(key)) {
    		this.dn = value;
    	} else if (value != null
                && !value.isEmpty()
                && key != null
                && !key.isEmpty()) {
            addAttribute(new BasicAttribute(key, value, true));
        }
    }
468478
public ValueMap withBoolean(String key, boolean val) {
        super.put(key, Boolean.valueOf(val));
        return this;
    }
50553
public boolean getBoolean(String key, boolean defaultValue) {
		addToDefaults(key, Boolean.toString(defaultValue));
		String value = get(key);
		if (value == null) {
			return defaultValue;
		} else {
			return Boolean.valueOf(value);
		}
	}
699294
public static Matcher<Map<String, Object>> hasAttribute(final String key, final Object value) {
    return new Matcher<Map<String, Object>>() {

      @Override
      protected boolean matchesSafely(Map<String, Object> object) {
        return object.containsKey(key) && value.equals(object.get(key));
      }
    };
  }
544855
public function setAttribute($key, $value)
    {
        if (array_key_exists($key, static::$attributeTypeMapping)) {
            $type = strtolower(static::$attributeTypeMapping[$key]);
            switch ($type) {
                case 'boolean':
                case 'bool':
                    $value = (bool) filter_var($value, FILTER_VALIDATE_BOOLEAN);
                    break;
                case 'integer':
                case 'int':
                    $value = (int) $value;
                    break;
                case 'float':
                    $value = (float) $value;
                    break;
                case 'string':
                default:
                    $value = (string) $value;
                    break;
            }

            $this->attributes[$key] = $value;
        } else {
            throw new \InvalidArgumentException("Unexpected attribute '$key'.");
        }

        return $this;
    }
1101282
public static Set<Attribute> context(String key, String value){
        if(null==key) {
            throw new IllegalArgumentException("key cannot be null");
        }
        if(null==value){
            throw new IllegalArgumentException("value cannot be null");
        }
        return Collections.singleton(
                new Attribute(
                        URI.create(EnvironmentalContext.URI_BASE + key),
                        value
                )
        );
    }