public void addDataUsageFor(String activity, String attribute, DataUsage dataUsage) throws CompatibilityException {
                validateActivity(activity);
                validateAttribute(attribute);
                Validate.notNull(dataUsage);
                if (activityDataUsage.get(activity) == null) {
                        activityDataUsage.put(activity, new HashMap<>());
                }
                if (activityDataUsage.get(activity).get(attribute) == null) {
                        activityDataUsage.get(activity).put(attribute, new HashSet<>());
                }
                activityDataUsage.get(activity).get(attribute).add(dataUsage);
        }
public void addDataUsageFor ( String activity , String attribute , DataUsage dataUsage ) throws CompatibilityException { validateActivity ( activity ) ; validateAttribute ( attribute ) ; Validate . notNull ( dataUsage ) ; if ( activityDataUsage . get ( activity ) == null ) { activityDataUsage . put ( activity , new HashMap < > ( ) ) ; } if ( activityDataUsage . get ( activity ) . get ( attribute ) == null ) { activityDataUsage . get ( activity ) . put ( attribute , new HashSet < > ( ) ) ; } activityDataUsage . get ( activity ) . get ( attribute ) . add ( dataUsage ) ; }
Adds a data attribute for an activity together with its usage.<br>
The given activity/attributes have to be known by the context, i.e.
be contained in the activity/attribute list.<br>
When dataUsage is null, then no usage is added.

@param activity Activity for which the attribute usage is set.
@param attribute Attribute used by the given activity.
@param dataUsage Usage of the data attribute by the given activity.
@throws ParameterException
@throws CompatibilityException
@throws IllegalArgumentException IllegalArgumentException If the
given activity/attributes are not known.
@see #getActivities()
@see #getAttributes()
@see #setAttributes(Set)