//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// 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: 2016.04.04 at 11:07:26 PM BST
//
package pl.baczkowicz.spy.common.generated;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy;
import org.jvnet.jaxb2_commons.lang.CopyTo;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
/**
* <p>Java class for FormatterDetails complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="FormatterDetails">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="ID" type="{http://www.w3.org/2001/XMLSchema}ID"/>
* <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="Function" type="{http://baczkowicz.pl/spy/common}FormatterFunction" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FormatterDetails", propOrder = {
"name",
"id",
"description",
"function"
})
public class FormatterDetails implements Serializable, Cloneable, CopyTo, Equals, HashCode, ToString
{
private final static long serialVersionUID = 1L;
@XmlElement(name = "Name", required = true)
protected String name;
@XmlElement(name = "ID", required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
@XmlElement(name = "Description")
protected String description;
@XmlElement(name = "Function", required = true)
protected List<FormatterFunction> function;
/**
* Default no-arg constructor
*
*/
public FormatterDetails() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public FormatterDetails(final String name, final String id, final String description, final List<FormatterFunction> function) {
this.name = name;
this.id = id;
this.description = description;
this.function = function;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getID() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setID(String value) {
this.id = value;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the function property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the function property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getFunction().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link FormatterFunction }
*
*
*/
public List<FormatterFunction> getFunction() {
if (function == null) {
function = new ArrayList<FormatterFunction>();
}
return this.function;
}
public String toString() {
final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE;
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
{
String theName;
theName = this.getName();
strategy.appendField(locator, this, "name", buffer, theName);
}
{
String theID;
theID = this.getID();
strategy.appendField(locator, this, "id", buffer, theID);
}
{
String theDescription;
theDescription = this.getDescription();
strategy.appendField(locator, this, "description", buffer, theDescription);
}
{
List<FormatterFunction> theFunction;
theFunction = (((this.function!= null)&&(!this.function.isEmpty()))?this.getFunction():null);
strategy.appendField(locator, this, "function", buffer, theFunction);
}
return buffer;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
if (!(object instanceof FormatterDetails)) {
return false;
}
if (this == object) {
return true;
}
final FormatterDetails that = ((FormatterDetails) object);
{
String lhsName;
lhsName = this.getName();
String rhsName;
rhsName = that.getName();
if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) {
return false;
}
}
{
String lhsID;
lhsID = this.getID();
String rhsID;
rhsID = that.getID();
if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsID), LocatorUtils.property(thatLocator, "id", rhsID), lhsID, rhsID)) {
return false;
}
}
{
String lhsDescription;
lhsDescription = this.getDescription();
String rhsDescription;
rhsDescription = that.getDescription();
if (!strategy.equals(LocatorUtils.property(thisLocator, "description", lhsDescription), LocatorUtils.property(thatLocator, "description", rhsDescription), lhsDescription, rhsDescription)) {
return false;
}
}
{
List<FormatterFunction> lhsFunction;
lhsFunction = (((this.function!= null)&&(!this.function.isEmpty()))?this.getFunction():null);
List<FormatterFunction> rhsFunction;
rhsFunction = (((that.function!= null)&&(!that.function.isEmpty()))?that.getFunction():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "function", lhsFunction), LocatorUtils.property(thatLocator, "function", rhsFunction), lhsFunction, rhsFunction)) {
return false;
}
}
return true;
}
public boolean equals(Object object) {
final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
return equals(null, null, object, strategy);
}
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
int currentHashCode = 1;
{
String theName;
theName = this.getName();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName);
}
{
String theID;
theID = this.getID();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theID), currentHashCode, theID);
}
{
String theDescription;
theDescription = this.getDescription();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "description", theDescription), currentHashCode, theDescription);
}
{
List<FormatterFunction> theFunction;
theFunction = (((this.function!= null)&&(!this.function.isEmpty()))?this.getFunction():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "function", theFunction), currentHashCode, theFunction);
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public Object clone() {
return copyTo(createNewInstance());
}
public Object copyTo(Object target) {
final CopyStrategy strategy = JAXBCopyStrategy.INSTANCE;
return copyTo(null, target, strategy);
}
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) {
final Object draftCopy = ((target == null)?createNewInstance():target);
if (draftCopy instanceof FormatterDetails) {
final FormatterDetails copy = ((FormatterDetails) draftCopy);
if (this.name!= null) {
String sourceName;
sourceName = this.getName();
String copyName = ((String) strategy.copy(LocatorUtils.property(locator, "name", sourceName), sourceName));
copy.setName(copyName);
} else {
copy.name = null;
}
if (this.id!= null) {
String sourceID;
sourceID = this.getID();
String copyID = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceID), sourceID));
copy.setID(copyID);
} else {
copy.id = null;
}
if (this.description!= null) {
String sourceDescription;
sourceDescription = this.getDescription();
String copyDescription = ((String) strategy.copy(LocatorUtils.property(locator, "description", sourceDescription), sourceDescription));
copy.setDescription(copyDescription);
} else {
copy.description = null;
}
if ((this.function!= null)&&(!this.function.isEmpty())) {
List<FormatterFunction> sourceFunction;
sourceFunction = (((this.function!= null)&&(!this.function.isEmpty()))?this.getFunction():null);
@SuppressWarnings("unchecked")
List<FormatterFunction> copyFunction = ((List<FormatterFunction> ) strategy.copy(LocatorUtils.property(locator, "function", sourceFunction), sourceFunction));
copy.function = null;
if (copyFunction!= null) {
List<FormatterFunction> uniqueFunctionl = copy.getFunction();
uniqueFunctionl.addAll(copyFunction);
}
} else {
copy.function = null;
}
}
return draftCopy;
}
public Object createNewInstance() {
return new FormatterDetails();
}
}