Adds a new empty attribute mapping to a target attribute

@return the newly created attribute mapping.
505183
public AttributeMapping addAttributeMapping(String targetAttributeName) {
    if (attributeMappings.containsKey(targetAttributeName)) {
      throw new IllegalStateException(
          "AttributeMapping already exists for target attribute " + targetAttributeName);
    }
    Attribute targetAttribute = targetEntityType.getAttribute(targetAttributeName);
    AttributeMapping attributeMapping = new AttributeMapping(targetAttribute);
    attributeMappings.put(targetAttributeName, attributeMapping);
    return attributeMapping;
  }
1363669
public PlacementDescription withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
1192634
@Override
    @Trivial
    public Map<String, ExtendedAttributeDefinition> getAttributeMap() {
        Map<String, ExtendedAttributeDefinition> map = null;
        AttributeDefinition[] attrDefs = getAttributeDefinitions(ObjectClassDefinition.ALL);
        if (attrDefs != null) {
            map = new HashMap<String, ExtendedAttributeDefinition>();
            for (AttributeDefinition attrDef : attrDefs) {
                map.put(attrDef.getID(), new ExtendedAttributeDefinitionImpl(attrDef));
            }
        } else {
            map = Collections.emptyMap();
        }
        return map;
    }
288166
public BaseBo setAttributes(Map<String, Object> attrs) {
        Lock lock = lockForWrite();
        try {
            attributes = initAttributes(attrs);
            triggerPopulate();
            return this;
        } finally {
            lock.unlock();
        }
    }
415584
private void addAttribute(int list, TreeHtmlAttributeInfo attr, RemoveInfo removes)
    {
        ArrayList al = _lists[list];
        // if the array list is the empty list then we need to allocate a new array list
        if (al == empty) {
            al = new ArrayList();
            _lists[list] = al;
        }

        // check to see if this attribute is already inside the tree.
        int cnt = al.size();
        for (int i = 0; i < cnt; i++) {
            TreeHtmlAttributeInfo a = (TreeHtmlAttributeInfo) al.get(i);
            assert(a != null);
            if (a.getAttribute().equals(attr.getAttribute())) {
                removes.removes.add(a);
                if (!attr.isApplyToDescendents()) {
                    removes.scopeOverrides = true;
                }
                al.remove(a);
                break;
            }
        }

        // add this to the list
        al.add(attr);
    }
621955
public AbstractPrintQuery addAttribute(final CIAttribute... _attributes)
        throws EFapsException
    {
        if (isMarked4execute()) {
            for (final CIAttribute attr : _attributes) {
                addAttribute(attr.name);
            }
        }
        return this;
    }
1310828
public UpdateIdentityProviderRequest withAttributeMapping(java.util.Map<String, String> attributeMapping) {
        setAttributeMapping(attributeMapping);
        return this;
    }
225706
public int addAttribute(String attrId) {
        if (attributeMapper.containsKey(attrId)) {
            return attributeMapper.get(attrId);        // attribute-id has existed
        }

        attributeMapper.put(attrId, varIdCounter);
        varIdCounter++;
        return attributeMapper.get(attrId);
    }
810437
public GetSMSAttributesResult withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
1215311
public Event addAttribute(String key, Object value) {
		eventAttributes.put(key, (value == null ? "null" : value));
		return this;
	}
1186783
public App withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
890806
public Attribute addAttribute(QuotedID id, int type, String typeName, boolean canNull) {
		Attribute att = new Attribute(this, new QualifiedAttributeID(getID(), id),
				attributes.size() + 1, type, typeName, canNull,
				typeMapper.getTermType(type, typeName));
		
		//check for duplicate names (put returns the previous value)
		Attribute prev = attributeMap.put(id, att);
		if (prev != null) 
			throw new IllegalArgumentException("Duplicate attribute names");
		
		attributes.add(att);
		return att;
	}
131505
public void putAttribute(String key, AttributeValue value) {
    // Not final because for performance reasons we want to override this in the implementation.
    // Also a default implementation is needed to not break the compatibility (users may extend this
    // for testing).
    Utils.checkNotNull(key, "key");
    Utils.checkNotNull(value, "value");
    putAttributes(Collections.singletonMap(key, value));
  }
952916
public Map<String, Attribute> getAttributes() {
        Map<String, Attribute> result = new HashMap<>();
        DataSourceAttribute datasourceAttribute = new DataSourceAttribute();
        Map<String, Attribute> dsResult = new HashMap<>();
        dsResult.put(MAP_KEY, this.mapAttribute);
        datasourceAttribute.setAttributes(dsResult);
        result.put("datasource", datasourceAttribute);
        return result;
    }
1185389
public AbstractPrintQuery addAttribute(final String... _attrNames)
        throws EFapsException
    {
        final Type type = getMainType();
        if (type != null) {
            for (final String attrName : _attrNames) {
                final Attribute attr = type.getAttribute(attrName);
                if (attr == null) {
                    final AttributeSet set = AttributeSet.find(type.getName(), attrName);
                    if (set != null) {
                        addAttributeSet(set);
                    }
                } else {
                    addAttribute(attr);
                }
            }
        }
        return this;
    }
143199
public static AssociationAttribute<?> createEmptyAssociationAttribute(AssociationAttributeInfo info) {
		AssociationAttribute<?> association;
		switch (info.getType()) {
			case MANY_TO_ONE:
				association = new ManyToOneAttribute();
				break;
			case ONE_TO_MANY:
				association = new OneToManyAttribute();
				break;
			default:
				String msg = "Trying to build an unknown association attribute type " + info.getType();
				Log.logError(msg);
				throw new IllegalStateException(msg);
		}
		association.setEditable(info.isEditable());
		return association;
	}
1024053
public Attribute put(String attributeName) {
        Attribute attr = attributes.get(attributeName);
        if (attr == null) {
            attr = new Attribute();
        }
        attributes.put(attributeName, attr);
        return attr;
    }