Add the given attribute if {@code value => 0}.

@param name
@param value
@return a reference to this object
482556
public XmlStringBuilder optIntAttribute(String name, int value) {
        if (value >= 0) {
            attribute(name, Integer.toString(value));
        }
        return this;
    }
1161769
public void setAttribute(String attrname, String value) {
        if (attributes == null)
            attributes = new ArrayList<Attribute>();
        Attribute.setAttribute(attributes, attrname, value);
    }
1231351
public void setAttribute(String name, String value)
	{
		if (value != null)
			getElement().setAttribute(name, value);
		else
			getElement().removeAttribute(name);
	}
906010
public Node attribute(final String name, final String value) {
        this.attributes.put(name, value);
        return this;
    }
313310
public void put(String name, String value) {
    List<String> list = new ArrayList<>();
    list.add(value);
    getMap().put(name, list);
  }
1289505
public void addAttribute(String name, String value) {
        checkType(name, String.class);
        attributes.put(name, value);
    }
329744
public String setAttribute(final String name, final String value) {
        if(null!=value){
            return getAttributes().put(name, value);
        }else{
            getAttributes().remove(name);
            return value;
        }
    }
966967
public void changeAttribute (String name, Object value)
    {
        Accessor acc = getAccessor(name);
        requestAttributeChange(name, value, acc.get(this));
        acc.set(this, value);
    }
641709
public final T setAttributeValueAsLong(String name, long value) {
    setAttribute(name, Long.toString(value));
    return (T)this;
  }
825729
public void addValueTo(Object value, String name) {
        getMapHelper().addValueToIn(value, name, getCurrentValues());
    }
69251
public void setBooleanAttribute(String name, Boolean value) {
		ensureValue();
		Attribute attribute = new BooleanAttribute(value);
		attribute.setEditable(isEditable(name));
		getValue().getAllAttributes().put(name, attribute);
	}
53239
public EventBuilder addField(String name, Object value){
		event.addField(name, value);
		return this;
	}
207990
public void addAttributeValue(String attributeName, String value) {

        if (m_entityAttributes.containsKey(attributeName)) {
            throw new RuntimeException("Attribute already exists with a entity type value.");
        }
        if (m_simpleAttributes.containsKey(attributeName)) {
            m_simpleAttributes.get(attributeName).add(value);
        } else {
            List<String> values = new ArrayList<String>();
            values.add(value);
            m_simpleAttributes.put(attributeName, values);
        }
        fireChange();
    }
1095541
public void add(String name, String value) {
    if (containsKey(name)) {
      get(name).add(value);
    } else {
      put(name, value);
    }
  }
412154
public void addParam(String name, String value) {
        getParams().add(new BasicNameValuePair(name, value));
    }
256270
public static Object setAttribute(String name, Object value)
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();

    return setAttribute(name, value, loader);
  }
525665
public Node attribute(final String name, final Object value) {
        return attribute(name, String.valueOf(value));
    }