package org.ovirt.engine.core.vdsbroker.xmlrpc;

import java.util.*;

public class XmlRpcStruct {

    private Map<String, Object> innerMap;

    public XmlRpcStruct(Map<String, Object> innerMap) {
        this.innerMap = innerMap;
    }

    public XmlRpcStruct() {
        this.innerMap = new HashMap<String, Object>();
    }

    public Object getItem(String key) {
        return innerMap.get(key);
    }

    public void add(String key, Map<String, String> map) {
        innerMap.put(key, map);
    }

    public void add(String key, List<String> map) {
        innerMap.put(key, map);
    }

    public void add(String key, XmlRpcStruct map) {
        innerMap.put(key, map.getInnerMap());
    }

    public void add(String key, String value) {
        innerMap.put(key, value);

    }

    public boolean containsKey(String name) {
        return innerMap.containsKey(name);
    }

    public boolean contains(String diskTotal) {
        return innerMap.containsKey(diskTotal);
    }

    public Set<String> getKeys() {
        return innerMap.keySet();
    }

    public void add(String key, Map[] drives) {
        innerMap.put(key, drives);
    }

    public int getCount() {
        if (innerMap != null) {
            return innerMap.size();
        } else {
            return 0;
        }
    }

    public void add(String sysprepInf, byte[] binarySysPrep) {
        innerMap.put(sysprepInf, binarySysPrep);

    }

    public void add(String key, int value) {
        innerMap.put(key, value);

    }

    public Set<Map.Entry<String, Object>> getEntries() {
        return innerMap.entrySet();
    }

    public Map<String, Object> getInnerMap() {
        return innerMap;
    }
}

@@ -63,9 +63,82 @@
 til.
-*
+HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set
 ;%0A%0Ap
@@ -1217,32 +1217,333 @@
 drives);%0A    %7D%0A%0A
+    public void add(String key, XmlRpcStruct%5B%5D devices) %7B%0A        int i = 0;%0A        // TODO work with typed collection%0A        Map%5B%5D map = new Map%5Bdevices.length%5D;%0A        for (XmlRpcStruct device : devices) %7B%0A            map%5Bi++%5D = device.getInnerMap();%0A        %7D%0A        this.add(key, map);%0A    %7D%0A%0A
     public int g

Add functioality to XMLRpcStruct to process array of XmlRpcStruct