/** * Set an attribute (key=value). If the attribute already exists, it is replaced. The attribute key comparison is * <b>case insensitive</b>. * @param attributeKey The attribute key. * @param attributeValue The attribute value. * @return this (for chaining) */ public Node attr(String attributeKey, String attributeValue) { attributes().putIgnoreCase(attributeKey, attributeValue); return this; }
/** * 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 */ public Attributes put(String key, boolean value) { if (value) putIgnoreCase(key, null); else remove(key); return this; }