// // 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.wrapper; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.validation.Valid; 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.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import net.di2e.jaxb.cdr.describe.sp.ServiceProvider; 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 anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element ref="{urn:cdr-ex:describe:sp:1.0}serviceProvider"/> * <element ref="{urn:cdr-ex:describe:wrapper:1.0}collection" maxOccurs="100"/> * </sequence> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "serviceProvider", "collection" }) @XmlRootElement(name = "describe") public class Describe implements Serializable, Cloneable, CopyTo2, Equals2, HashCode2, MergeFrom2, ToString2 { private final static long serialVersionUID = 1L; @XmlElement(namespace = "urn:cdr-ex:describe:sp:1.0", required = true) @NotNull(message = "Describe.serviceProvider {javax.validation.constraints.NotNull.message}") @Valid protected ServiceProvider serviceProvider; @XmlElement(required = true) @NotNull(message = "Describe.collection {javax.validation.constraints.NotNull.message}") @Size(min = 1, max = 100) @Valid protected List<Collection> collection; /** * Gets the value of the serviceProvider property. * * @return * possible object is * {@link ServiceProvider } * */ public ServiceProvider getServiceProvider() { return serviceProvider; } /** * Sets the value of the serviceProvider property. * * @param value * allowed object is * {@link ServiceProvider } * */ public void setServiceProvider(ServiceProvider value) { this.serviceProvider = value; } public boolean isSetServiceProvider() { return (this.serviceProvider!= null); } /** * Gets the value of the collection 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 collection property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCollection().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Collection } * * */ public List<Collection> getCollection() { if (collection == null) { collection = new ArrayList<Collection>(); } return this.collection; } public boolean isSetCollection() { return ((this.collection!= null)&&(!this.collection.isEmpty())); } public void unsetCollection() { this.collection = 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) { { ServiceProvider theServiceProvider; theServiceProvider = this.getServiceProvider(); strategy.appendField(locator, this, "serviceProvider", buffer, theServiceProvider, this.isSetServiceProvider()); } { List<Collection> theCollection; theCollection = (this.isSetCollection()?this.getCollection():null); strategy.appendField(locator, this, "collection", buffer, theCollection, this.isSetCollection()); } 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 Describe that = ((Describe) object); { ServiceProvider lhsServiceProvider; lhsServiceProvider = this.getServiceProvider(); ServiceProvider rhsServiceProvider; rhsServiceProvider = that.getServiceProvider(); if (!strategy.equals(LocatorUtils.property(thisLocator, "serviceProvider", lhsServiceProvider), LocatorUtils.property(thatLocator, "serviceProvider", rhsServiceProvider), lhsServiceProvider, rhsServiceProvider, this.isSetServiceProvider(), that.isSetServiceProvider())) { return false; } } { List<Collection> lhsCollection; lhsCollection = (this.isSetCollection()?this.getCollection():null); List<Collection> rhsCollection; rhsCollection = (that.isSetCollection()?that.getCollection():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "collection", lhsCollection), LocatorUtils.property(thatLocator, "collection", rhsCollection), lhsCollection, rhsCollection, this.isSetCollection(), that.isSetCollection())) { 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; { ServiceProvider theServiceProvider; theServiceProvider = this.getServiceProvider(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "serviceProvider", theServiceProvider), currentHashCode, theServiceProvider, this.isSetServiceProvider()); } { List<Collection> theCollection; theCollection = (this.isSetCollection()?this.getCollection():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "collection", theCollection), currentHashCode, theCollection, this.isSetCollection()); } 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 Describe) { final Describe copy = ((Describe) draftCopy); { Boolean serviceProviderShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetServiceProvider()); if (serviceProviderShouldBeCopiedAndSet == Boolean.TRUE) { ServiceProvider sourceServiceProvider; sourceServiceProvider = this.getServiceProvider(); ServiceProvider copyServiceProvider = ((ServiceProvider) strategy.copy(LocatorUtils.property(locator, "serviceProvider", sourceServiceProvider), sourceServiceProvider, this.isSetServiceProvider())); copy.setServiceProvider(copyServiceProvider); } else { if (serviceProviderShouldBeCopiedAndSet == Boolean.FALSE) { copy.serviceProvider = null; } } } { Boolean collectionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetCollection()); if (collectionShouldBeCopiedAndSet == Boolean.TRUE) { List<Collection> sourceCollection; sourceCollection = (this.isSetCollection()?this.getCollection():null); @SuppressWarnings("unchecked") List<Collection> copyCollection = ((List<Collection> ) strategy.copy(LocatorUtils.property(locator, "collection", sourceCollection), sourceCollection, this.isSetCollection())); copy.unsetCollection(); if (copyCollection!= null) { List<Collection> uniqueCollectionl = copy.getCollection(); uniqueCollectionl.addAll(copyCollection); } } else { if (collectionShouldBeCopiedAndSet == Boolean.FALSE) { copy.unsetCollection(); } } } } return draftCopy; } public Object createNewInstance() { return new Describe(); } 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 Describe) { final Describe target = this; final Describe leftObject = ((Describe) left); final Describe rightObject = ((Describe) right); { Boolean serviceProviderShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetServiceProvider(), rightObject.isSetServiceProvider()); if (serviceProviderShouldBeMergedAndSet == Boolean.TRUE) { ServiceProvider lhsServiceProvider; lhsServiceProvider = leftObject.getServiceProvider(); ServiceProvider rhsServiceProvider; rhsServiceProvider = rightObject.getServiceProvider(); ServiceProvider mergedServiceProvider = ((ServiceProvider) strategy.merge(LocatorUtils.property(leftLocator, "serviceProvider", lhsServiceProvider), LocatorUtils.property(rightLocator, "serviceProvider", rhsServiceProvider), lhsServiceProvider, rhsServiceProvider, leftObject.isSetServiceProvider(), rightObject.isSetServiceProvider())); target.setServiceProvider(mergedServiceProvider); } else { if (serviceProviderShouldBeMergedAndSet == Boolean.FALSE) { target.serviceProvider = null; } } } { Boolean collectionShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetCollection(), rightObject.isSetCollection()); if (collectionShouldBeMergedAndSet == Boolean.TRUE) { List<Collection> lhsCollection; lhsCollection = (leftObject.isSetCollection()?leftObject.getCollection():null); List<Collection> rhsCollection; rhsCollection = (rightObject.isSetCollection()?rightObject.getCollection():null); List<Collection> mergedCollection = ((List<Collection> ) strategy.merge(LocatorUtils.property(leftLocator, "collection", lhsCollection), LocatorUtils.property(rightLocator, "collection", rhsCollection), lhsCollection, rhsCollection, leftObject.isSetCollection(), rightObject.isSetCollection())); target.unsetCollection(); if (mergedCollection!= null) { List<Collection> uniqueCollectionl = target.getCollection(); uniqueCollectionl.addAll(mergedCollection); } } else { if (collectionShouldBeMergedAndSet == Boolean.FALSE) { target.unsetCollection(); } } } } } public void setCollection(List<Collection> value) { this.collection = null; if (value!= null) { List<Collection> draftl = this.getCollection(); draftl.addAll(value); } } }