// // 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 org.isotc211._2005.gmd; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.validation.Valid; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; import org.isotc211._2005.gco.AbstractObjectType; 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; /** * Information about the distributor of and options for obtaining the dataset * * <p>Java class for MD_Distribution_Type complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="MD_Distribution_Type"> * <complexContent> * <extension base="{http://www.isotc211.org/2005/gco}AbstractObject_Type"> * <sequence> * <element name="distributionFormat" type="{http://www.isotc211.org/2005/gmd}MD_Format_PropertyType" maxOccurs="unbounded" minOccurs="0"/> * <element name="distributor" type="{http://www.isotc211.org/2005/gmd}MD_Distributor_PropertyType" maxOccurs="unbounded" minOccurs="0"/> * <element name="transferOptions" type="{http://www.isotc211.org/2005/gmd}MD_DigitalTransferOptions_PropertyType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </extension> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "MD_Distribution_Type", propOrder = { "distributionFormat", "distributor", "transferOptions" }) public class MDDistributionType extends AbstractObjectType implements Serializable, Cloneable, CopyTo2, Equals2, HashCode2, MergeFrom2, ToString2 { private final static long serialVersionUID = 1L; @Valid protected List<MDFormatPropertyType> distributionFormat; @Valid protected List<MDDistributorPropertyType> distributor; @Valid protected List<MDDigitalTransferOptionsPropertyType> transferOptions; /** * Gets the value of the distributionFormat 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 distributionFormat property. * * <p> * For example, to add a new item, do as follows: * <pre> * getDistributionFormat().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link MDFormatPropertyType } * * */ public List<MDFormatPropertyType> getDistributionFormat() { if (distributionFormat == null) { distributionFormat = new ArrayList<MDFormatPropertyType>(); } return this.distributionFormat; } public boolean isSetDistributionFormat() { return ((this.distributionFormat!= null)&&(!this.distributionFormat.isEmpty())); } public void unsetDistributionFormat() { this.distributionFormat = null; } /** * Gets the value of the distributor 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 distributor property. * * <p> * For example, to add a new item, do as follows: * <pre> * getDistributor().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link MDDistributorPropertyType } * * */ public List<MDDistributorPropertyType> getDistributor() { if (distributor == null) { distributor = new ArrayList<MDDistributorPropertyType>(); } return this.distributor; } public boolean isSetDistributor() { return ((this.distributor!= null)&&(!this.distributor.isEmpty())); } public void unsetDistributor() { this.distributor = null; } /** * Gets the value of the transferOptions 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 transferOptions property. * * <p> * For example, to add a new item, do as follows: * <pre> * getTransferOptions().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link MDDigitalTransferOptionsPropertyType } * * */ public List<MDDigitalTransferOptionsPropertyType> getTransferOptions() { if (transferOptions == null) { transferOptions = new ArrayList<MDDigitalTransferOptionsPropertyType>(); } return this.transferOptions; } public boolean isSetTransferOptions() { return ((this.transferOptions!= null)&&(!this.transferOptions.isEmpty())); } public void unsetTransferOptions() { this.transferOptions = 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) { super.appendFields(locator, buffer, strategy); { List<MDFormatPropertyType> theDistributionFormat; theDistributionFormat = (this.isSetDistributionFormat()?this.getDistributionFormat():null); strategy.appendField(locator, this, "distributionFormat", buffer, theDistributionFormat, this.isSetDistributionFormat()); } { List<MDDistributorPropertyType> theDistributor; theDistributor = (this.isSetDistributor()?this.getDistributor():null); strategy.appendField(locator, this, "distributor", buffer, theDistributor, this.isSetDistributor()); } { List<MDDigitalTransferOptionsPropertyType> theTransferOptions; theTransferOptions = (this.isSetTransferOptions()?this.getTransferOptions():null); strategy.appendField(locator, this, "transferOptions", buffer, theTransferOptions, this.isSetTransferOptions()); } 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; } if (!super.equals(thisLocator, thatLocator, object, strategy)) { return false; } final MDDistributionType that = ((MDDistributionType) object); { List<MDFormatPropertyType> lhsDistributionFormat; lhsDistributionFormat = (this.isSetDistributionFormat()?this.getDistributionFormat():null); List<MDFormatPropertyType> rhsDistributionFormat; rhsDistributionFormat = (that.isSetDistributionFormat()?that.getDistributionFormat():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "distributionFormat", lhsDistributionFormat), LocatorUtils.property(thatLocator, "distributionFormat", rhsDistributionFormat), lhsDistributionFormat, rhsDistributionFormat, this.isSetDistributionFormat(), that.isSetDistributionFormat())) { return false; } } { List<MDDistributorPropertyType> lhsDistributor; lhsDistributor = (this.isSetDistributor()?this.getDistributor():null); List<MDDistributorPropertyType> rhsDistributor; rhsDistributor = (that.isSetDistributor()?that.getDistributor():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "distributor", lhsDistributor), LocatorUtils.property(thatLocator, "distributor", rhsDistributor), lhsDistributor, rhsDistributor, this.isSetDistributor(), that.isSetDistributor())) { return false; } } { List<MDDigitalTransferOptionsPropertyType> lhsTransferOptions; lhsTransferOptions = (this.isSetTransferOptions()?this.getTransferOptions():null); List<MDDigitalTransferOptionsPropertyType> rhsTransferOptions; rhsTransferOptions = (that.isSetTransferOptions()?that.getTransferOptions():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "transferOptions", lhsTransferOptions), LocatorUtils.property(thatLocator, "transferOptions", rhsTransferOptions), lhsTransferOptions, rhsTransferOptions, this.isSetTransferOptions(), that.isSetTransferOptions())) { 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 = super.hashCode(locator, strategy); { List<MDFormatPropertyType> theDistributionFormat; theDistributionFormat = (this.isSetDistributionFormat()?this.getDistributionFormat():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "distributionFormat", theDistributionFormat), currentHashCode, theDistributionFormat, this.isSetDistributionFormat()); } { List<MDDistributorPropertyType> theDistributor; theDistributor = (this.isSetDistributor()?this.getDistributor():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "distributor", theDistributor), currentHashCode, theDistributor, this.isSetDistributor()); } { List<MDDigitalTransferOptionsPropertyType> theTransferOptions; theTransferOptions = (this.isSetTransferOptions()?this.getTransferOptions():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "transferOptions", theTransferOptions), currentHashCode, theTransferOptions, this.isSetTransferOptions()); } 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); super.copyTo(locator, draftCopy, strategy); if (draftCopy instanceof MDDistributionType) { final MDDistributionType copy = ((MDDistributionType) draftCopy); { Boolean distributionFormatShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetDistributionFormat()); if (distributionFormatShouldBeCopiedAndSet == Boolean.TRUE) { List<MDFormatPropertyType> sourceDistributionFormat; sourceDistributionFormat = (this.isSetDistributionFormat()?this.getDistributionFormat():null); @SuppressWarnings("unchecked") List<MDFormatPropertyType> copyDistributionFormat = ((List<MDFormatPropertyType> ) strategy.copy(LocatorUtils.property(locator, "distributionFormat", sourceDistributionFormat), sourceDistributionFormat, this.isSetDistributionFormat())); copy.unsetDistributionFormat(); if (copyDistributionFormat!= null) { List<MDFormatPropertyType> uniqueDistributionFormatl = copy.getDistributionFormat(); uniqueDistributionFormatl.addAll(copyDistributionFormat); } } else { if (distributionFormatShouldBeCopiedAndSet == Boolean.FALSE) { copy.unsetDistributionFormat(); } } } { Boolean distributorShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetDistributor()); if (distributorShouldBeCopiedAndSet == Boolean.TRUE) { List<MDDistributorPropertyType> sourceDistributor; sourceDistributor = (this.isSetDistributor()?this.getDistributor():null); @SuppressWarnings("unchecked") List<MDDistributorPropertyType> copyDistributor = ((List<MDDistributorPropertyType> ) strategy.copy(LocatorUtils.property(locator, "distributor", sourceDistributor), sourceDistributor, this.isSetDistributor())); copy.unsetDistributor(); if (copyDistributor!= null) { List<MDDistributorPropertyType> uniqueDistributorl = copy.getDistributor(); uniqueDistributorl.addAll(copyDistributor); } } else { if (distributorShouldBeCopiedAndSet == Boolean.FALSE) { copy.unsetDistributor(); } } } { Boolean transferOptionsShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetTransferOptions()); if (transferOptionsShouldBeCopiedAndSet == Boolean.TRUE) { List<MDDigitalTransferOptionsPropertyType> sourceTransferOptions; sourceTransferOptions = (this.isSetTransferOptions()?this.getTransferOptions():null); @SuppressWarnings("unchecked") List<MDDigitalTransferOptionsPropertyType> copyTransferOptions = ((List<MDDigitalTransferOptionsPropertyType> ) strategy.copy(LocatorUtils.property(locator, "transferOptions", sourceTransferOptions), sourceTransferOptions, this.isSetTransferOptions())); copy.unsetTransferOptions(); if (copyTransferOptions!= null) { List<MDDigitalTransferOptionsPropertyType> uniqueTransferOptionsl = copy.getTransferOptions(); uniqueTransferOptionsl.addAll(copyTransferOptions); } } else { if (transferOptionsShouldBeCopiedAndSet == Boolean.FALSE) { copy.unsetTransferOptions(); } } } } return draftCopy; } public Object createNewInstance() { return new MDDistributionType(); } 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) { super.mergeFrom(leftLocator, rightLocator, left, right, strategy); if (right instanceof MDDistributionType) { final MDDistributionType target = this; final MDDistributionType leftObject = ((MDDistributionType) left); final MDDistributionType rightObject = ((MDDistributionType) right); { Boolean distributionFormatShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetDistributionFormat(), rightObject.isSetDistributionFormat()); if (distributionFormatShouldBeMergedAndSet == Boolean.TRUE) { List<MDFormatPropertyType> lhsDistributionFormat; lhsDistributionFormat = (leftObject.isSetDistributionFormat()?leftObject.getDistributionFormat():null); List<MDFormatPropertyType> rhsDistributionFormat; rhsDistributionFormat = (rightObject.isSetDistributionFormat()?rightObject.getDistributionFormat():null); List<MDFormatPropertyType> mergedDistributionFormat = ((List<MDFormatPropertyType> ) strategy.merge(LocatorUtils.property(leftLocator, "distributionFormat", lhsDistributionFormat), LocatorUtils.property(rightLocator, "distributionFormat", rhsDistributionFormat), lhsDistributionFormat, rhsDistributionFormat, leftObject.isSetDistributionFormat(), rightObject.isSetDistributionFormat())); target.unsetDistributionFormat(); if (mergedDistributionFormat!= null) { List<MDFormatPropertyType> uniqueDistributionFormatl = target.getDistributionFormat(); uniqueDistributionFormatl.addAll(mergedDistributionFormat); } } else { if (distributionFormatShouldBeMergedAndSet == Boolean.FALSE) { target.unsetDistributionFormat(); } } } { Boolean distributorShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetDistributor(), rightObject.isSetDistributor()); if (distributorShouldBeMergedAndSet == Boolean.TRUE) { List<MDDistributorPropertyType> lhsDistributor; lhsDistributor = (leftObject.isSetDistributor()?leftObject.getDistributor():null); List<MDDistributorPropertyType> rhsDistributor; rhsDistributor = (rightObject.isSetDistributor()?rightObject.getDistributor():null); List<MDDistributorPropertyType> mergedDistributor = ((List<MDDistributorPropertyType> ) strategy.merge(LocatorUtils.property(leftLocator, "distributor", lhsDistributor), LocatorUtils.property(rightLocator, "distributor", rhsDistributor), lhsDistributor, rhsDistributor, leftObject.isSetDistributor(), rightObject.isSetDistributor())); target.unsetDistributor(); if (mergedDistributor!= null) { List<MDDistributorPropertyType> uniqueDistributorl = target.getDistributor(); uniqueDistributorl.addAll(mergedDistributor); } } else { if (distributorShouldBeMergedAndSet == Boolean.FALSE) { target.unsetDistributor(); } } } { Boolean transferOptionsShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetTransferOptions(), rightObject.isSetTransferOptions()); if (transferOptionsShouldBeMergedAndSet == Boolean.TRUE) { List<MDDigitalTransferOptionsPropertyType> lhsTransferOptions; lhsTransferOptions = (leftObject.isSetTransferOptions()?leftObject.getTransferOptions():null); List<MDDigitalTransferOptionsPropertyType> rhsTransferOptions; rhsTransferOptions = (rightObject.isSetTransferOptions()?rightObject.getTransferOptions():null); List<MDDigitalTransferOptionsPropertyType> mergedTransferOptions = ((List<MDDigitalTransferOptionsPropertyType> ) strategy.merge(LocatorUtils.property(leftLocator, "transferOptions", lhsTransferOptions), LocatorUtils.property(rightLocator, "transferOptions", rhsTransferOptions), lhsTransferOptions, rhsTransferOptions, leftObject.isSetTransferOptions(), rightObject.isSetTransferOptions())); target.unsetTransferOptions(); if (mergedTransferOptions!= null) { List<MDDigitalTransferOptionsPropertyType> uniqueTransferOptionsl = target.getTransferOptions(); uniqueTransferOptionsl.addAll(mergedTransferOptions); } } else { if (transferOptionsShouldBeMergedAndSet == Boolean.FALSE) { target.unsetTransferOptions(); } } } } } public void setDistributionFormat(List<MDFormatPropertyType> value) { this.distributionFormat = null; if (value!= null) { List<MDFormatPropertyType> draftl = this.getDistributionFormat(); draftl.addAll(value); } } public void setDistributor(List<MDDistributorPropertyType> value) { this.distributor = null; if (value!= null) { List<MDDistributorPropertyType> draftl = this.getDistributor(); draftl.addAll(value); } } public void setTransferOptions(List<MDDigitalTransferOptionsPropertyType> value) { this.transferOptions = null; if (value!= null) { List<MDDigitalTransferOptionsPropertyType> draftl = this.getTransferOptions(); draftl.addAll(value); } } }