/*
* Dog - Core
*
* Copyright (c) 2009-2014 Dario Bonino and Luigi De Russis
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.02.15 at 03:00:00 PM CEST
//
package it.polito.elite.dog.core.library.jaxb;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
/**
* <p>
* Classe Java per controlFunctionality complex type.
*
* <p>
* Il seguente frammento di schema specifica il contenuto previsto contenuto in
* questa classe.
*
* <pre>
* <complexType name="controlFunctionality">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="commands" type="{http://elite.polito.it/dogHomeConfiguration}commands"/>
* </sequence>
* <attribute name="class" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "controlFunctionality", propOrder = { "commands" })
public class ControlFunctionality implements Cloneable
{
@XmlElement(required = true)
@JsonIgnore
protected Commands commands;
// workaround for properly serialize a JSON message: it avoids a "redundant"
// array
@XmlTransient
@JsonProperty("commands")
protected List<Configcommand> commandList;
@XmlAttribute(name = "class", required = true)
@JsonProperty("class")
protected String clazz;
/**
* Creates a new {@code ControlFunctionality} instance.
*
*/
public ControlFunctionality()
{
// CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
super();
}
/**
* Creates a new {@code ControlFunctionality} instance by deeply copying a
* given {@code ControlFunctionality} instance.
*
*
* @param o
* The instance to copy.
* @throws NullPointerException
* if {@code o} is {@code null}.
*/
public ControlFunctionality(final ControlFunctionality o)
{
// CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
super();
if (o == null)
{
throw new NullPointerException("Cannot create a copy of 'ControlFunctionality' from 'null'.");
}
// CClassInfo: it.polito.elite.dog.core.library.jaxb.Commands
this.commands = ((o.commands == null) ? null : ((o.getCommands() == null) ? null : o.getCommands().clone()));
// CBuiltinLeafInfo: java.lang.String
this.clazz = ((o.clazz == null) ? null : o.getClazz());
// 'Configcommand' collection.
if (o.commandList != null)
{
copyCommands(o.getCommandList(), this.getCommandList());
}
}
/**
* Gets the value of the commands property.
*
* @return possible object is {@link Commands }
*
*/
public Commands getCommands()
{
return commands;
}
/**
* Sets the value of the commands property.
*
* @param value
* allowed object is {@link Commands }
*
*/
public void setCommands(Commands value)
{
this.commands = value;
}
/**
* Gets the value of the clazz property.
*
* @return possible object is {@link String }
*
*/
public String getClazz()
{
return clazz;
}
/**
* Sets the value of the clazz property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setClazz(String value)
{
this.clazz = value;
}
/**
* Workaround for properly serialize a JSON message; it is not considered in
* XML
*
* @return the commandlist
*/
public List<Configcommand> getCommandList()
{
if (commandList == null)
{
commandList = new ArrayList<Configcommand>();
}
return this.commandList;
}
/**
* Workaround for properly serialize a JSON message; it is not considered in
* XML
*
* @param commandList
* the commandList to set
*/
public void setCommandList(List<Configcommand> commandList)
{
this.commandList = commandList;
}
/**
* Copies all values of property {@code CommandList} deeply.
*
* @param source
* The source to copy from.
* @param target
* The target to copy {@code source} to.
* @throws NullPointerException
* if {@code target} is {@code null}.
*/
private static void copyCommands(final List<Configcommand> source, final List<Configcommand> target)
{
// CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
if ((source != null) && (!source.isEmpty()))
{
for (final Iterator<?> it = source.iterator(); it.hasNext();)
{
final Object next = it.next();
if (next instanceof Configcommand)
{
// CClassInfo:
// it.polito.elite.dog.core.library.jaxb.Configcommand
target.add(((Configcommand) next).clone());
continue;
}
// Please report this at
// https://apps.sourceforge.net/mantisbt/ccxjc/
throw new AssertionError(
(("Unexpected instance '" + next) + "' for property 'CommandList' of class 'it.polito.elite.dog.core.library.jaxb.ControlFunctionality'."));
}
}
}
/**
* Creates and returns a deep copy of this object.
*
*
* @return A deep copy of this object.
*/
@Override
public ControlFunctionality clone()
{
try
{
{
// CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
final ControlFunctionality clone = ((ControlFunctionality) super.clone());
// CClassInfo: it.polito.elite.dog.core.library.jaxb.Commands
clone.commands = ((this.commands == null) ? null : ((this.getCommands() == null) ? null : this
.getCommands().clone()));
// CBuiltinLeafInfo: java.lang.String
clone.clazz = ((this.clazz == null) ? null : this.getClazz());
// 'Configcommand' collection.
if (this.commandList != null)
{
clone.commandList = null;
copyCommands(this.getCommandList(), clone.getCommandList());
}
return clone;
}
}
catch (CloneNotSupportedException e)
{
// Please report this at
// https://apps.sourceforge.net/mantisbt/ccxjc/
throw new AssertionError(e);
}
}
}