//
// 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:27 PM BST
//
package pl.baczkowicz.mqttspy.common.generated;
import java.io.Serializable;
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.XmlSeeAlso;
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 ConnectionDetails complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ConnectionDetails">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="ID" type="{http://www.w3.org/2001/XMLSchema}ID" minOccurs="0"/>
* <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="Protocol" type="{http://baczkowicz.pl/mqtt-spy/common}ProtocolVersionEnum" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ConnectionDetails", propOrder = {
"id",
"name",
"protocol"
})
@XmlSeeAlso({
MqttConnectionDetails.class
})
public class ConnectionDetails implements Serializable, Cloneable, CopyTo, Equals, HashCode, ToString
{
private final static long serialVersionUID = 1L;
@XmlElement(name = "ID")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
@XmlElement(name = "Name")
protected String name;
@XmlElement(name = "Protocol")
@XmlSchemaType(name = "string")
protected ProtocolVersionEnum protocol;
/**
* Default no-arg constructor
*
*/
public ConnectionDetails() {
super();
}
/**
* Fully-initialising value constructor
*
*/
public ConnectionDetails(final String id, final String name, final ProtocolVersionEnum protocol) {
this.id = id;
this.name = name;
this.protocol = protocol;
}
/**
* 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 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 protocol property.
*
* @return
* possible object is
* {@link ProtocolVersionEnum }
*
*/
public ProtocolVersionEnum getProtocol() {
return protocol;
}
/**
* Sets the value of the protocol property.
*
* @param value
* allowed object is
* {@link ProtocolVersionEnum }
*
*/
public void setProtocol(ProtocolVersionEnum value) {
this.protocol = value;
}
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 theID;
theID = this.getID();
strategy.appendField(locator, this, "id", buffer, theID);
}
{
String theName;
theName = this.getName();
strategy.appendField(locator, this, "name", buffer, theName);
}
{
ProtocolVersionEnum theProtocol;
theProtocol = this.getProtocol();
strategy.appendField(locator, this, "protocol", buffer, theProtocol);
}
return buffer;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
if (!(object instanceof ConnectionDetails)) {
return false;
}
if (this == object) {
return true;
}
final ConnectionDetails that = ((ConnectionDetails) object);
{
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 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;
}
}
{
ProtocolVersionEnum lhsProtocol;
lhsProtocol = this.getProtocol();
ProtocolVersionEnum rhsProtocol;
rhsProtocol = that.getProtocol();
if (!strategy.equals(LocatorUtils.property(thisLocator, "protocol", lhsProtocol), LocatorUtils.property(thatLocator, "protocol", rhsProtocol), lhsProtocol, rhsProtocol)) {
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 theID;
theID = this.getID();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theID), currentHashCode, theID);
}
{
String theName;
theName = this.getName();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName);
}
{
ProtocolVersionEnum theProtocol;
theProtocol = this.getProtocol();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "protocol", theProtocol), currentHashCode, theProtocol);
}
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 ConnectionDetails) {
final ConnectionDetails copy = ((ConnectionDetails) draftCopy);
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.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.protocol!= null) {
ProtocolVersionEnum sourceProtocol;
sourceProtocol = this.getProtocol();
ProtocolVersionEnum copyProtocol = ((ProtocolVersionEnum) strategy.copy(LocatorUtils.property(locator, "protocol", sourceProtocol), sourceProtocol));
copy.setProtocol(copyProtocol);
} else {
copy.protocol = null;
}
}
return draftCopy;
}
public Object createNewInstance() {
return new ConnectionDetails();
}
}