PageRenderTime 30ms CodeModel.GetById 14ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

/integrations/opennms-vmware/src/main/java/org/opennms/netmgt/config/vmware/cim/VmwareCimCollection.java

https://github.com/ajakubo1/opennms
Java | 317 lines | 123 code | 32 blank | 162 comment | 7 complexity | 83c61aa3c3078b0cba3f8d0578a0826f MD5 | raw file
  1/*******************************************************************************
  2 * This file is part of OpenNMS(R).
  3 *
  4 * Copyright (C) 2012 The OpenNMS Group, Inc.
  5 * OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc.
  6 *
  7 * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
  8 *
  9 * OpenNMS(R) is free software: you can redistribute it and/or modify
 10 * it under the terms of the GNU General Public License as published
 11 * by the Free Software Foundation, either version 3 of the License,
 12 * or (at your option) any later version.
 13 *
 14 * OpenNMS(R) is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 17 * GNU General Public License for more details.
 18 *
 19 * You should have received a copy of the GNU General Public License
 20 * along with OpenNMS(R).  If not, see:
 21 *      http://www.gnu.org/licenses/
 22 *
 23 * For more information contact:
 24 *     OpenNMS(R) Licensing <license@opennms.org>
 25 *     http://www.opennms.org/
 26 *     http://www.opennms.com/
 27 *******************************************************************************/
 28
 29package org.opennms.netmgt.config.vmware.cim;
 30
 31import org.apache.commons.lang.builder.EqualsBuilder;
 32
 33import javax.xml.bind.annotation.*;
 34
 35/**
 36 * A grouping of VMware related RRD parms and performance counter
 37 * groups
 38 *
 39 * @version $Revision$ $Date$
 40 */
 41@XmlRootElement(name = "vmware-cim-collection")
 42@XmlAccessorType(XmlAccessType.FIELD)
 43@SuppressWarnings("all")
 44public class VmwareCimCollection implements java.io.Serializable {
 45
 46    /**
 47     * Field _name.
 48     */
 49    @XmlAttribute(name = "name")
 50    private java.lang.String _name;
 51
 52    /**
 53     * RRD parms
 54     */
 55    @XmlElement(name = "rrd")
 56    private org.opennms.netmgt.config.vmware.cim.Rrd _rrd;
 57
 58    /**
 59     * VMware Cim object groups
 60     */
 61    @XmlElementWrapper(name = "vmware-cim-groups")
 62    @XmlElement(name = "vmware-cim-group")
 63    private java.util.List<org.opennms.netmgt.config.vmware.cim.VmwareCimGroup> _vmwareCimGroupList;
 64
 65    public VmwareCimCollection() {
 66        super();
 67        this._vmwareCimGroupList = new java.util.ArrayList<org.opennms.netmgt.config.vmware.cim.VmwareCimGroup>();
 68    }
 69
 70    /**
 71     * Overrides the java.lang.Object.equals method.
 72     *
 73     * @param obj
 74     * @return true if the objects are equal.
 75     */
 76    @Override()
 77    public boolean equals(
 78            final java.lang.Object obj) {
 79        if (obj instanceof VmwareCimCollection) {
 80            VmwareCimCollection other = (VmwareCimCollection) obj;
 81            return new EqualsBuilder()
 82                    .append(getName(), other.getName())
 83                    .append(getRrd(), other.getRrd())
 84                    .append(getVmwareCimGroup(), other.getVmwareCimGroup())
 85                    .isEquals();
 86        }
 87        return false;
 88    }
 89
 90
 91    /**
 92     * Returns the value of field 'name'.
 93     *
 94     * @return the value of field 'Name'.
 95     */
 96    public java.lang.String getName(
 97    ) {
 98        return this._name == null ? "" : this._name;
 99    }
100
101    /**
102     * Returns the value of field 'rrd'. The field 'rrd' has the
103     * following description: RRD parms
104     *
105     * @return the value of field 'Rrd'.
106     */
107    public org.opennms.netmgt.config.vmware.cim.Rrd getRrd(
108    ) {
109        return this._rrd;
110    }
111
112    /**
113     * @param vVmwareCimGroup
114     * @throws java.lang.IndexOutOfBoundsException
115     *          if the index
116     *          given is outside the bounds of the collection
117     */
118    public void addVmwareCimGroup(
119            final org.opennms.netmgt.config.vmware.cim.VmwareCimGroup vVmwareCimGroup)
120            throws java.lang.IndexOutOfBoundsException {
121        this._vmwareCimGroupList.add(vVmwareCimGroup);
122    }
123
124    /**
125     * @param index
126     * @param vVmwareCimGroup
127     * @throws java.lang.IndexOutOfBoundsException
128     *          if the index
129     *          given is outside the bounds of the collection
130     */
131    public void addVmwareCimGroup(
132            final int index,
133            final org.opennms.netmgt.config.vmware.cim.VmwareCimGroup vVmwareCimGroup)
134            throws java.lang.IndexOutOfBoundsException {
135        this._vmwareCimGroupList.add(index, vVmwareCimGroup);
136    }
137
138    /**
139     * Method enumerateVmwareCimGroup.
140     *
141     * @return an Enumeration over all possible elements of this
142     *         collection
143     */
144    public java.util.Enumeration<org.opennms.netmgt.config.vmware.cim.VmwareCimGroup> enumerateVmwareCimGroup(
145    ) {
146        return java.util.Collections.enumeration(this._vmwareCimGroupList);
147    }
148
149    /**
150     * Sets the value of field 'name'.
151     *
152     * @param name the value of field 'name'.
153     */
154    public void setName(
155            final java.lang.String name) {
156        this._name = name;
157    }
158
159    /**
160     * Sets the value of field 'rrd'. The field 'rrd' has the
161     * following description: RRD parms
162     *
163     * @param rrd the value of field 'rrd'.
164     */
165    public void setRrd(
166            final org.opennms.netmgt.config.vmware.cim.Rrd rrd) {
167        this._rrd = rrd;
168    }
169
170    /**
171     * Method getVmwareCimGroup.
172     *
173     * @param index
174     * @return the value of the
175     *         org.opennms.netmgt.config.vmware.cim.VmwareCimGroup at the
176     *         given index
177     * @throws java.lang.IndexOutOfBoundsException
178     *          if the index
179     *          given is outside the bounds of the collection
180     */
181    public org.opennms.netmgt.config.vmware.cim.VmwareCimGroup getVmwareCimGroup(
182            final int index)
183            throws java.lang.IndexOutOfBoundsException {
184        // check bounds for index
185        if (index < 0 || index >= this._vmwareCimGroupList.size()) {
186            throw new IndexOutOfBoundsException("getVmwareCimGroup: Index value '" + index + "' not in range [0.." + (this._vmwareCimGroupList.size() - 1) + "]");
187        }
188
189        return (org.opennms.netmgt.config.vmware.cim.VmwareCimGroup) _vmwareCimGroupList.get(index);
190    }
191
192    /**
193     * Method getVmwareCimGroup.Returns the contents of the
194     * collection in an Array.  <p>Note:  Just in case the
195     * collection contents are changing in another thread, we pass
196     * a 0-length Array of the correct type into the API call.
197     * This way we <i>know</i> that the Array returned is of
198     * exactly the correct length.
199     *
200     * @return this collection as an Array
201     */
202    public org.opennms.netmgt.config.vmware.cim.VmwareCimGroup[] getVmwareCimGroup(
203    ) {
204        org.opennms.netmgt.config.vmware.cim.VmwareCimGroup[] array = new org.opennms.netmgt.config.vmware.cim.VmwareCimGroup[0];
205        return (org.opennms.netmgt.config.vmware.cim.VmwareCimGroup[]) this._vmwareCimGroupList.toArray(array);
206    }
207
208    /**
209     * Method getVmwareCimGroupCollection.Returns a reference to
210     * '_vmwareCimGroupList'. No type checking is performed on any
211     * modifications to the Vector.
212     *
213     * @return a reference to the Vector backing this class
214     */
215    public java.util.List<org.opennms.netmgt.config.vmware.cim.VmwareCimGroup> getVmwareCimGroupCollection(
216    ) {
217        return this._vmwareCimGroupList;
218    }
219
220    /**
221     * Method getVmwareCimGroupCount.
222     *
223     * @return the size of this collection
224     */
225    public int getVmwareCimGroupCount(
226    ) {
227        return this._vmwareCimGroupList.size();
228    }
229
230    /**
231     * Method iterateVmwareCimGroup.
232     *
233     * @return an Iterator over all possible elements in this
234     *         collection
235     */
236    public java.util.Iterator<org.opennms.netmgt.config.vmware.cim.VmwareCimGroup> iterateVmwareCimGroup(
237    ) {
238        return this._vmwareCimGroupList.iterator();
239    }
240
241    /**
242     */
243    public void removeAllVmwareCimGroup(
244    ) {
245        this._vmwareCimGroupList.clear();
246    }
247
248    /**
249     * Method removeVmwareCimGroup.
250     *
251     * @param vVmwareCimGroup
252     * @return true if the object was removed from the collection.
253     */
254    public boolean removeVmwareCimGroup(
255            final org.opennms.netmgt.config.vmware.cim.VmwareCimGroup vVmwareCimGroup) {
256        boolean removed = _vmwareCimGroupList.remove(vVmwareCimGroup);
257        return removed;
258    }
259
260    /**
261     * Method removeVmwareCimGroupAt.
262     *
263     * @param index
264     * @return the element removed from the collection
265     */
266    public org.opennms.netmgt.config.vmware.cim.VmwareCimGroup removeVmwareCimGroupAt(
267            final int index) {
268        java.lang.Object obj = this._vmwareCimGroupList.remove(index);
269        return (org.opennms.netmgt.config.vmware.cim.VmwareCimGroup) obj;
270    }
271
272    /**
273     * @param index
274     * @param vVmwareCimGroup
275     * @throws java.lang.IndexOutOfBoundsException
276     *          if the index
277     *          given is outside the bounds of the collection
278     */
279    public void setVmwareCimGroup(
280            final int index,
281            final org.opennms.netmgt.config.vmware.cim.VmwareCimGroup vVmwareCimGroup)
282            throws java.lang.IndexOutOfBoundsException {
283        // check bounds for index
284        if (index < 0 || index >= this._vmwareCimGroupList.size()) {
285            throw new IndexOutOfBoundsException("setVmwareCimGroup: Index value '" + index + "' not in range [0.." + (this._vmwareCimGroupList.size() - 1) + "]");
286        }
287
288        this._vmwareCimGroupList.set(index, vVmwareCimGroup);
289    }
290
291    /**
292     * @param vVmwareCimGroupArray
293     */
294    public void setVmwareCimGroup(
295            final org.opennms.netmgt.config.vmware.cim.VmwareCimGroup[] vVmwareCimGroupArray) {
296        //-- copy array
297        _vmwareCimGroupList.clear();
298
299        for (int i = 0; i < vVmwareCimGroupArray.length; i++) {
300            this._vmwareCimGroupList.add(vVmwareCimGroupArray[i]);
301        }
302    }
303
304    /**
305     * Sets the value of '_vmwareCimGroupList' by copying the given
306     * Vector. All elements will be checked for type safety.
307     *
308     * @param vVmwareCimGroupList the Vector to copy.
309     */
310    public void setVmwareCimGroup(
311            final java.util.List<org.opennms.netmgt.config.vmware.cim.VmwareCimGroup> vVmwareCimGroupList) {
312        // copy vector
313        this._vmwareCimGroupList.clear();
314
315        this._vmwareCimGroupList.addAll(vVmwareCimGroupList);
316    }
317}