<p>
A list of thing attributes which are name-value pairs.
</p>

@param attributes
A list of thing attributes which are name-value pairs.
@return Returns a reference to this object so that method calls can be chained together.
330243
public ThingAttribute withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
511328
public final void setAttributes(final Map<String, Attribute> attributes) {
        for (Map.Entry<String, Attribute> entry: attributes.entrySet()) {
            Object attribute = entry.getValue();
            if (!(attribute instanceof Attribute)) {
                final String msg =
                        "Attribute: '" + entry.getKey() + "' is not an attribute. It is a: " + attribute;
                LOGGER.error("Error setting the Attributes: {}", msg);
                throw new IllegalArgumentException(msg);
            } else {
                ((Attribute) attribute).setConfigName(entry.getKey());
            }
        }
        this.attributes = attributes;
    }
561154
public void setAttributes(ArrayList<Attribute> attributes)
  {
    if (_attributes != attributes) {
      _attributes.clear();
      _attributes.addAll(attributes);
    }
  }
45696
public Attribute getAttribute(String name)
  {
    ArrayList<Attribute> attributeList = getAttributeList();
    
    for (int i = attributeList.size() - 1; i >= 0; i--) {
      Attribute attr = attributeList.get(i);

      if (attr.getName().equals(name))
        return attr;
    }

    return null;
  }
613693
public void setAttributes(Map<String, ?> attributes) {
        if (attributes == null) {
            attributes = new HashMap<>();
        }

        this.attributes.clear();
        this.attributes.putAll(attributes);
    }
619279
public synchronized Filter addAttributes(Map<String, String> attributes) {
    for(Map.Entry<String, String> pair : attributes.entrySet()) {
      String key = pair.getKey();
      String value = pair.getValue();
      this.attributes.put(key, value);
    }
    return this;
  }
381612
public Map<String, Object> getAttributes() {
        if (attributes == null) {
            return null;
        }
        Lock lock = lockForRead();
        try {
            return cloneData(attributes);
        } finally {
            lock.unlock();
        }
    }
170352
public static ImmutableSet<ResultAttribute> forNames(@Nonnull Collection<String> attributeNames) {
		ImmutableSet.Builder<ResultAttribute> builder = ImmutableSet.<ResultAttribute>builder();
		for (String attributeName : attributeNames) {
			builder.add(forName(attributeName));
		}
		return builder.build();
	}
833706
public Iterator<Attribute<?>> attrs() {
        final AtomicReferenceArray<DefaultAttribute<?>> attributes = this.attributes;
        if (attributes == null) {
            return Collections.emptyIterator();
        }

        return new IteratorImpl(attributes);
    }
278915
@Override
    public Enumeration<String> getAttributeNames() {

        Vector<String> v = new Vector<String>();
        v.addAll(m_attributes.keySet());
        return v.elements();
    }
111573
public Map<String, String> getAttributes() {
    if (attributes == null) {
      return null;
    } else {
      return Collections.unmodifiableMap(attributes);
    }
  }
591057
public Scope setAttributes(Iterable<Pair> attributes)
    {
        if (attributes == null)
        {
            this.attributes = null;

            return this;
        }

        List<Pair> list = new ArrayList<Pair>();

        for (Pair attribute : attributes)
        {
            if (attribute == null || attribute.getKey() == null)
            {
                continue;
            }

            list.add(attribute);
        }

        int size = list.size();

        if (size == 0)
        {
            this.attributes = null;

            return this;
        }

        Pair[] array = new Pair[size];
        this.attributes = list.toArray(array);

        return this;
    }
615381
public ThingDocument withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
510862
@SuppressWarnings("unchecked")
    public String[] getAttributeNames() {

        List<String> names = new ArrayList<String>();
        Enumeration<String> keys = attributes.keys();
        while (keys.hasMoreElements()) {
            names.add((String) keys.nextElement());
        }
        String results[] = new String[names.size()];
        for (int i = 0; i < results.length; i++) {
            results[i] = (String) names.get(i);
        }
        return (results);

    }
732757
private void extractAttributes(final String attributes)
	{
		String s = attributes.trim();
		if (s.length() > 0 && s.charAt(s.length() - 1) == '/')
			emptyTag = true;

		while (s.length() != 0) {
			final int equal = s.indexOf('=');
			if (equal == -1 || equal == s.length() - 1)
				break;
			// cut off attribute name
			final String att = s.substring(0, equal).trim();
			s = s.substring(equal + 1).trim();
			if (s.length() == 0)
				break;
			final boolean quote = s.charAt(0) == '\'' || s.charAt(0) == '\"';
			if (att.length() > 0 && quote) {
				String value = s.substring(1);
				final int end = value.indexOf(s.charAt(0));
				if (end >= 0)
					value = value.substring(0, end);
				attributeName.add(att);
				attributeValue.add(References.replace(value, false));
			}
			final int i = s.indexOf(quote ? s.charAt(0) : ' ', 1);
			s = i == -1 ? "" : s.substring(i + 1);
		}
	}
407017
public Object setAttribute(String name, Object attribute)
    {
        if (_attributes==null)
            _attributes=new HashMap(11);
        return _attributes.put(name,attribute);
    }
713953
@Override
    public List<Object> getAttributeValues(final String name) {
        final List<Object> values = this.attributes.get(name);
        if (values == null) {
            return null;
        }

        return values;
    }