//
// 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.07.27 at 04:06:37 PM EDT
//
package net.di2e.jaxb.cdr.describe.sp;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.Equals2;
import org.jvnet.jaxb2_commons.lang.EqualsStrategy2;
import org.jvnet.jaxb2_commons.lang.HashCode2;
import org.jvnet.jaxb2_commons.lang.HashCodeStrategy2;
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.JAXBMergeStrategy;
import org.jvnet.jaxb2_commons.lang.JAXBToStringStrategy;
import org.jvnet.jaxb2_commons.lang.MergeFrom2;
import org.jvnet.jaxb2_commons.lang.MergeStrategy2;
import org.jvnet.jaxb2_commons.lang.ToString2;
import org.jvnet.jaxb2_commons.lang.ToStringStrategy2;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
/**
* <p>Java class for AddressType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="AddressType">
* <simpleContent>
* <extension base="<urn:cdr-ex:describe:sp:1.0>SimpleTokenType">
* <attribute name="protocol" use="required" type="{urn:cdr-ex:describe:sp:1.0}ProtocolValuesType" />
* <attribute name="network" type="{urn:cdr-ex:describe:sp:1.0}NetworkValuesType" />
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AddressType", propOrder = {
"value"
})
public class AddressType implements Serializable, Cloneable, CopyTo2, Equals2, HashCode2, MergeFrom2, ToString2
{
private final static long serialVersionUID = 1L;
@XmlValue
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@Size(min = 1)
protected String value;
@XmlAttribute(name = "protocol", required = true)
@NotNull(message = "AddressType.protocol {javax.validation.constraints.NotNull.message}")
protected String protocol;
@XmlAttribute(name = "network")
protected List<String> network;
/**
* type created to ensure an element / attribute is
* comprised of more than whitespace, tab, newline, etc.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
public boolean isSetValue() {
return (this.value!= null);
}
/**
* Gets the value of the protocol property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getProtocol() {
return protocol;
}
/**
* Sets the value of the protocol property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setProtocol(String value) {
this.protocol = value;
}
public boolean isSetProtocol() {
return (this.protocol!= null);
}
/**
* Gets the value of the network 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 network property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNetwork().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getNetwork() {
if (network == null) {
network = new ArrayList<String>();
}
return this.network;
}
public boolean isSetNetwork() {
return ((this.network!= null)&&(!this.network.isEmpty()));
}
public void unsetNetwork() {
this.network = null;
}
public String toString() {
final ToStringStrategy2 strategy = JAXBToStringStrategy.INSTANCE;
final StringBuilder buffer = new StringBuilder();
append(null, buffer, strategy);
return buffer.toString();
}
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
strategy.appendStart(locator, this, buffer);
appendFields(locator, buffer, strategy);
strategy.appendEnd(locator, this, buffer);
return buffer;
}
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) {
{
String theValue;
theValue = this.getValue();
strategy.appendField(locator, this, "value", buffer, theValue, this.isSetValue());
}
{
String theProtocol;
theProtocol = this.getProtocol();
strategy.appendField(locator, this, "protocol", buffer, theProtocol, this.isSetProtocol());
}
{
List<String> theNetwork;
theNetwork = (this.isSetNetwork()?this.getNetwork():null);
strategy.appendField(locator, this, "network", buffer, theNetwork, this.isSetNetwork());
}
return buffer;
}
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy2 strategy) {
if ((object == null)||(this.getClass()!= object.getClass())) {
return false;
}
if (this == object) {
return true;
}
final AddressType that = ((AddressType) object);
{
String lhsValue;
lhsValue = this.getValue();
String rhsValue;
rhsValue = that.getValue();
if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue, this.isSetValue(), that.isSetValue())) {
return false;
}
}
{
String lhsProtocol;
lhsProtocol = this.getProtocol();
String rhsProtocol;
rhsProtocol = that.getProtocol();
if (!strategy.equals(LocatorUtils.property(thisLocator, "protocol", lhsProtocol), LocatorUtils.property(thatLocator, "protocol", rhsProtocol), lhsProtocol, rhsProtocol, this.isSetProtocol(), that.isSetProtocol())) {
return false;
}
}
{
List<String> lhsNetwork;
lhsNetwork = (this.isSetNetwork()?this.getNetwork():null);
List<String> rhsNetwork;
rhsNetwork = (that.isSetNetwork()?that.getNetwork():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "network", lhsNetwork), LocatorUtils.property(thatLocator, "network", rhsNetwork), lhsNetwork, rhsNetwork, this.isSetNetwork(), that.isSetNetwork())) {
return false;
}
}
return true;
}
public boolean equals(Object object) {
final EqualsStrategy2 strategy = JAXBEqualsStrategy.INSTANCE;
return equals(null, null, object, strategy);
}
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) {
int currentHashCode = 1;
{
String theValue;
theValue = this.getValue();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue, this.isSetValue());
}
{
String theProtocol;
theProtocol = this.getProtocol();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "protocol", theProtocol), currentHashCode, theProtocol, this.isSetProtocol());
}
{
List<String> theNetwork;
theNetwork = (this.isSetNetwork()?this.getNetwork():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "network", theNetwork), currentHashCode, theNetwork, this.isSetNetwork());
}
return currentHashCode;
}
public int hashCode() {
final HashCodeStrategy2 strategy = JAXBHashCodeStrategy.INSTANCE;
return this.hashCode(null, strategy);
}
public Object clone() {
return copyTo(createNewInstance());
}
public Object copyTo(Object target) {
final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
return copyTo(null, target, strategy);
}
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
final Object draftCopy = ((target == null)?createNewInstance():target);
if (draftCopy instanceof AddressType) {
final AddressType copy = ((AddressType) draftCopy);
{
Boolean valueShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetValue());
if (valueShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceValue;
sourceValue = this.getValue();
String copyValue = ((String) strategy.copy(LocatorUtils.property(locator, "value", sourceValue), sourceValue, this.isSetValue()));
copy.setValue(copyValue);
} else {
if (valueShouldBeCopiedAndSet == Boolean.FALSE) {
copy.value = null;
}
}
}
{
Boolean protocolShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetProtocol());
if (protocolShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceProtocol;
sourceProtocol = this.getProtocol();
String copyProtocol = ((String) strategy.copy(LocatorUtils.property(locator, "protocol", sourceProtocol), sourceProtocol, this.isSetProtocol()));
copy.setProtocol(copyProtocol);
} else {
if (protocolShouldBeCopiedAndSet == Boolean.FALSE) {
copy.protocol = null;
}
}
}
{
Boolean networkShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetNetwork());
if (networkShouldBeCopiedAndSet == Boolean.TRUE) {
List<String> sourceNetwork;
sourceNetwork = (this.isSetNetwork()?this.getNetwork():null);
@SuppressWarnings("unchecked")
List<String> copyNetwork = ((List<String> ) strategy.copy(LocatorUtils.property(locator, "network", sourceNetwork), sourceNetwork, this.isSetNetwork()));
copy.unsetNetwork();
if (copyNetwork!= null) {
List<String> uniqueNetworkl = copy.getNetwork();
uniqueNetworkl.addAll(copyNetwork);
}
} else {
if (networkShouldBeCopiedAndSet == Boolean.FALSE) {
copy.unsetNetwork();
}
}
}
}
return draftCopy;
}
public Object createNewInstance() {
return new AddressType();
}
public void mergeFrom(Object left, Object right) {
final MergeStrategy2 strategy = JAXBMergeStrategy.INSTANCE;
mergeFrom(null, null, left, right, strategy);
}
public void mergeFrom(ObjectLocator leftLocator, ObjectLocator rightLocator, Object left, Object right, MergeStrategy2 strategy) {
if (right instanceof AddressType) {
final AddressType target = this;
final AddressType leftObject = ((AddressType) left);
final AddressType rightObject = ((AddressType) right);
{
Boolean valueShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetValue(), rightObject.isSetValue());
if (valueShouldBeMergedAndSet == Boolean.TRUE) {
String lhsValue;
lhsValue = leftObject.getValue();
String rhsValue;
rhsValue = rightObject.getValue();
String mergedValue = ((String) strategy.merge(LocatorUtils.property(leftLocator, "value", lhsValue), LocatorUtils.property(rightLocator, "value", rhsValue), lhsValue, rhsValue, leftObject.isSetValue(), rightObject.isSetValue()));
target.setValue(mergedValue);
} else {
if (valueShouldBeMergedAndSet == Boolean.FALSE) {
target.value = null;
}
}
}
{
Boolean protocolShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetProtocol(), rightObject.isSetProtocol());
if (protocolShouldBeMergedAndSet == Boolean.TRUE) {
String lhsProtocol;
lhsProtocol = leftObject.getProtocol();
String rhsProtocol;
rhsProtocol = rightObject.getProtocol();
String mergedProtocol = ((String) strategy.merge(LocatorUtils.property(leftLocator, "protocol", lhsProtocol), LocatorUtils.property(rightLocator, "protocol", rhsProtocol), lhsProtocol, rhsProtocol, leftObject.isSetProtocol(), rightObject.isSetProtocol()));
target.setProtocol(mergedProtocol);
} else {
if (protocolShouldBeMergedAndSet == Boolean.FALSE) {
target.protocol = null;
}
}
}
{
Boolean networkShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetNetwork(), rightObject.isSetNetwork());
if (networkShouldBeMergedAndSet == Boolean.TRUE) {
List<String> lhsNetwork;
lhsNetwork = (leftObject.isSetNetwork()?leftObject.getNetwork():null);
List<String> rhsNetwork;
rhsNetwork = (rightObject.isSetNetwork()?rightObject.getNetwork():null);
List<String> mergedNetwork = ((List<String> ) strategy.merge(LocatorUtils.property(leftLocator, "network", lhsNetwork), LocatorUtils.property(rightLocator, "network", rhsNetwork), lhsNetwork, rhsNetwork, leftObject.isSetNetwork(), rightObject.isSetNetwork()));
target.unsetNetwork();
if (mergedNetwork!= null) {
List<String> uniqueNetworkl = target.getNetwork();
uniqueNetworkl.addAll(mergedNetwork);
}
} else {
if (networkShouldBeMergedAndSet == Boolean.FALSE) {
target.unsetNetwork();
}
}
}
}
}
public void setNetwork(List<String> value) {
this.network = null;
if (value!= null) {
List<String> draftl = this.getNetwork();
draftl.addAll(value);
}
}
}