class DecoupledTemplateLogic {


    private final Map<String, List<DecoupledInjectedAttribute>> injectedAttributes =
            new HashMap<String, List<DecoupledInjectedAttribute>>(20);


    public DecoupledTemplateLogic() {
        super();
    }



    public boolean hasInjectedAttributes() {
        return this.injectedAttributes.size() > 0;
    }


    public Set<String> getAllInjectedAttributeSelectors() {
        return this.injectedAttributes.keySet();
    }

    public List<DecoupledInjectedAttribute> getInjectedAttributesForSelector(final String selector) {
        return this.injectedAttributes.get(selector);
    }


    public void addInjectedAttribute(final String selector, final DecoupledInjectedAttribute injectedAttribute) {<FILL_FUNCTION_BODY>}



    @Override
    public String toString() {

        // We will order the keys so that we can more easily debug and test based on this toString()
        final List<String> keys = new ArrayList<String>(this.injectedAttributes.keySet());
        Collections.sort(keys);

        final StringBuilder strBuilder = new StringBuilder();
        strBuilder.append('{');
        for (int i = 0; i < keys.size(); i++) {
            if (i > 0) {
                strBuilder.append(", ");
            }
            strBuilder.append(keys.get(i));
            strBuilder.append('=');
            strBuilder.append(this.injectedAttributes.get(keys.get(i)));
        }
        strBuilder.append('}');

        return strBuilder.toString();

    }

}


        Validate.notNull(selector, "Selector cannot be null");
        Validate.notNull(injectedAttribute, "Injected Attribute cannot be null");

        List<DecoupledInjectedAttribute> injectedAttributesForSelector = this.injectedAttributes.get(selector);
        if (injectedAttributesForSelector == null) {
            injectedAttributesForSelector = new ArrayList<DecoupledInjectedAttribute>(2);
            this.injectedAttributes.put(selector, injectedAttributesForSelector);
        }

        injectedAttributesForSelector.add(injectedAttribute);

    
<no_super_class>