//
// 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.CharacterStringPropertyType;
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;
/**
* Restrictions and legal prerequisites for accessing and using the dataset.
*
* <p>Java class for MD_LegalConstraints_Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MD_LegalConstraints_Type">
* <complexContent>
* <extension base="{http://www.isotc211.org/2005/gmd}MD_Constraints_Type">
* <sequence>
* <element name="accessConstraints" type="{http://www.isotc211.org/2005/gmd}MD_RestrictionCode_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="useConstraints" type="{http://www.isotc211.org/2005/gmd}MD_RestrictionCode_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="otherConstraints" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MD_LegalConstraints_Type", propOrder = {
"accessConstraints",
"useConstraints",
"otherConstraints"
})
public class MDLegalConstraintsType
extends MDConstraintsType
implements Serializable, Cloneable, CopyTo2, Equals2, HashCode2, MergeFrom2, ToString2
{
private final static long serialVersionUID = 1L;
@Valid
protected List<MDRestrictionCodePropertyType> accessConstraints;
@Valid
protected List<MDRestrictionCodePropertyType> useConstraints;
@Valid
protected List<CharacterStringPropertyType> otherConstraints;
/**
* Gets the value of the accessConstraints 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 accessConstraints property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAccessConstraints().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDRestrictionCodePropertyType }
*
*
*/
public List<MDRestrictionCodePropertyType> getAccessConstraints() {
if (accessConstraints == null) {
accessConstraints = new ArrayList<MDRestrictionCodePropertyType>();
}
return this.accessConstraints;
}
public boolean isSetAccessConstraints() {
return ((this.accessConstraints!= null)&&(!this.accessConstraints.isEmpty()));
}
public void unsetAccessConstraints() {
this.accessConstraints = null;
}
/**
* Gets the value of the useConstraints 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 useConstraints property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getUseConstraints().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDRestrictionCodePropertyType }
*
*
*/
public List<MDRestrictionCodePropertyType> getUseConstraints() {
if (useConstraints == null) {
useConstraints = new ArrayList<MDRestrictionCodePropertyType>();
}
return this.useConstraints;
}
public boolean isSetUseConstraints() {
return ((this.useConstraints!= null)&&(!this.useConstraints.isEmpty()));
}
public void unsetUseConstraints() {
this.useConstraints = null;
}
/**
* Gets the value of the otherConstraints 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 otherConstraints property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getOtherConstraints().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CharacterStringPropertyType }
*
*
*/
public List<CharacterStringPropertyType> getOtherConstraints() {
if (otherConstraints == null) {
otherConstraints = new ArrayList<CharacterStringPropertyType>();
}
return this.otherConstraints;
}
public boolean isSetOtherConstraints() {
return ((this.otherConstraints!= null)&&(!this.otherConstraints.isEmpty()));
}
public void unsetOtherConstraints() {
this.otherConstraints = 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<MDRestrictionCodePropertyType> theAccessConstraints;
theAccessConstraints = (this.isSetAccessConstraints()?this.getAccessConstraints():null);
strategy.appendField(locator, this, "accessConstraints", buffer, theAccessConstraints, this.isSetAccessConstraints());
}
{
List<MDRestrictionCodePropertyType> theUseConstraints;
theUseConstraints = (this.isSetUseConstraints()?this.getUseConstraints():null);
strategy.appendField(locator, this, "useConstraints", buffer, theUseConstraints, this.isSetUseConstraints());
}
{
List<CharacterStringPropertyType> theOtherConstraints;
theOtherConstraints = (this.isSetOtherConstraints()?this.getOtherConstraints():null);
strategy.appendField(locator, this, "otherConstraints", buffer, theOtherConstraints, this.isSetOtherConstraints());
}
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 MDLegalConstraintsType that = ((MDLegalConstraintsType) object);
{
List<MDRestrictionCodePropertyType> lhsAccessConstraints;
lhsAccessConstraints = (this.isSetAccessConstraints()?this.getAccessConstraints():null);
List<MDRestrictionCodePropertyType> rhsAccessConstraints;
rhsAccessConstraints = (that.isSetAccessConstraints()?that.getAccessConstraints():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "accessConstraints", lhsAccessConstraints), LocatorUtils.property(thatLocator, "accessConstraints", rhsAccessConstraints), lhsAccessConstraints, rhsAccessConstraints, this.isSetAccessConstraints(), that.isSetAccessConstraints())) {
return false;
}
}
{
List<MDRestrictionCodePropertyType> lhsUseConstraints;
lhsUseConstraints = (this.isSetUseConstraints()?this.getUseConstraints():null);
List<MDRestrictionCodePropertyType> rhsUseConstraints;
rhsUseConstraints = (that.isSetUseConstraints()?that.getUseConstraints():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "useConstraints", lhsUseConstraints), LocatorUtils.property(thatLocator, "useConstraints", rhsUseConstraints), lhsUseConstraints, rhsUseConstraints, this.isSetUseConstraints(), that.isSetUseConstraints())) {
return false;
}
}
{
List<CharacterStringPropertyType> lhsOtherConstraints;
lhsOtherConstraints = (this.isSetOtherConstraints()?this.getOtherConstraints():null);
List<CharacterStringPropertyType> rhsOtherConstraints;
rhsOtherConstraints = (that.isSetOtherConstraints()?that.getOtherConstraints():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "otherConstraints", lhsOtherConstraints), LocatorUtils.property(thatLocator, "otherConstraints", rhsOtherConstraints), lhsOtherConstraints, rhsOtherConstraints, this.isSetOtherConstraints(), that.isSetOtherConstraints())) {
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<MDRestrictionCodePropertyType> theAccessConstraints;
theAccessConstraints = (this.isSetAccessConstraints()?this.getAccessConstraints():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "accessConstraints", theAccessConstraints), currentHashCode, theAccessConstraints, this.isSetAccessConstraints());
}
{
List<MDRestrictionCodePropertyType> theUseConstraints;
theUseConstraints = (this.isSetUseConstraints()?this.getUseConstraints():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "useConstraints", theUseConstraints), currentHashCode, theUseConstraints, this.isSetUseConstraints());
}
{
List<CharacterStringPropertyType> theOtherConstraints;
theOtherConstraints = (this.isSetOtherConstraints()?this.getOtherConstraints():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "otherConstraints", theOtherConstraints), currentHashCode, theOtherConstraints, this.isSetOtherConstraints());
}
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 MDLegalConstraintsType) {
final MDLegalConstraintsType copy = ((MDLegalConstraintsType) draftCopy);
{
Boolean accessConstraintsShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetAccessConstraints());
if (accessConstraintsShouldBeCopiedAndSet == Boolean.TRUE) {
List<MDRestrictionCodePropertyType> sourceAccessConstraints;
sourceAccessConstraints = (this.isSetAccessConstraints()?this.getAccessConstraints():null);
@SuppressWarnings("unchecked")
List<MDRestrictionCodePropertyType> copyAccessConstraints = ((List<MDRestrictionCodePropertyType> ) strategy.copy(LocatorUtils.property(locator, "accessConstraints", sourceAccessConstraints), sourceAccessConstraints, this.isSetAccessConstraints()));
copy.unsetAccessConstraints();
if (copyAccessConstraints!= null) {
List<MDRestrictionCodePropertyType> uniqueAccessConstraintsl = copy.getAccessConstraints();
uniqueAccessConstraintsl.addAll(copyAccessConstraints);
}
} else {
if (accessConstraintsShouldBeCopiedAndSet == Boolean.FALSE) {
copy.unsetAccessConstraints();
}
}
}
{
Boolean useConstraintsShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetUseConstraints());
if (useConstraintsShouldBeCopiedAndSet == Boolean.TRUE) {
List<MDRestrictionCodePropertyType> sourceUseConstraints;
sourceUseConstraints = (this.isSetUseConstraints()?this.getUseConstraints():null);
@SuppressWarnings("unchecked")
List<MDRestrictionCodePropertyType> copyUseConstraints = ((List<MDRestrictionCodePropertyType> ) strategy.copy(LocatorUtils.property(locator, "useConstraints", sourceUseConstraints), sourceUseConstraints, this.isSetUseConstraints()));
copy.unsetUseConstraints();
if (copyUseConstraints!= null) {
List<MDRestrictionCodePropertyType> uniqueUseConstraintsl = copy.getUseConstraints();
uniqueUseConstraintsl.addAll(copyUseConstraints);
}
} else {
if (useConstraintsShouldBeCopiedAndSet == Boolean.FALSE) {
copy.unsetUseConstraints();
}
}
}
{
Boolean otherConstraintsShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetOtherConstraints());
if (otherConstraintsShouldBeCopiedAndSet == Boolean.TRUE) {
List<CharacterStringPropertyType> sourceOtherConstraints;
sourceOtherConstraints = (this.isSetOtherConstraints()?this.getOtherConstraints():null);
@SuppressWarnings("unchecked")
List<CharacterStringPropertyType> copyOtherConstraints = ((List<CharacterStringPropertyType> ) strategy.copy(LocatorUtils.property(locator, "otherConstraints", sourceOtherConstraints), sourceOtherConstraints, this.isSetOtherConstraints()));
copy.unsetOtherConstraints();
if (copyOtherConstraints!= null) {
List<CharacterStringPropertyType> uniqueOtherConstraintsl = copy.getOtherConstraints();
uniqueOtherConstraintsl.addAll(copyOtherConstraints);
}
} else {
if (otherConstraintsShouldBeCopiedAndSet == Boolean.FALSE) {
copy.unsetOtherConstraints();
}
}
}
}
return draftCopy;
}
public Object createNewInstance() {
return new MDLegalConstraintsType();
}
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 MDLegalConstraintsType) {
final MDLegalConstraintsType target = this;
final MDLegalConstraintsType leftObject = ((MDLegalConstraintsType) left);
final MDLegalConstraintsType rightObject = ((MDLegalConstraintsType) right);
{
Boolean accessConstraintsShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetAccessConstraints(), rightObject.isSetAccessConstraints());
if (accessConstraintsShouldBeMergedAndSet == Boolean.TRUE) {
List<MDRestrictionCodePropertyType> lhsAccessConstraints;
lhsAccessConstraints = (leftObject.isSetAccessConstraints()?leftObject.getAccessConstraints():null);
List<MDRestrictionCodePropertyType> rhsAccessConstraints;
rhsAccessConstraints = (rightObject.isSetAccessConstraints()?rightObject.getAccessConstraints():null);
List<MDRestrictionCodePropertyType> mergedAccessConstraints = ((List<MDRestrictionCodePropertyType> ) strategy.merge(LocatorUtils.property(leftLocator, "accessConstraints", lhsAccessConstraints), LocatorUtils.property(rightLocator, "accessConstraints", rhsAccessConstraints), lhsAccessConstraints, rhsAccessConstraints, leftObject.isSetAccessConstraints(), rightObject.isSetAccessConstraints()));
target.unsetAccessConstraints();
if (mergedAccessConstraints!= null) {
List<MDRestrictionCodePropertyType> uniqueAccessConstraintsl = target.getAccessConstraints();
uniqueAccessConstraintsl.addAll(mergedAccessConstraints);
}
} else {
if (accessConstraintsShouldBeMergedAndSet == Boolean.FALSE) {
target.unsetAccessConstraints();
}
}
}
{
Boolean useConstraintsShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetUseConstraints(), rightObject.isSetUseConstraints());
if (useConstraintsShouldBeMergedAndSet == Boolean.TRUE) {
List<MDRestrictionCodePropertyType> lhsUseConstraints;
lhsUseConstraints = (leftObject.isSetUseConstraints()?leftObject.getUseConstraints():null);
List<MDRestrictionCodePropertyType> rhsUseConstraints;
rhsUseConstraints = (rightObject.isSetUseConstraints()?rightObject.getUseConstraints():null);
List<MDRestrictionCodePropertyType> mergedUseConstraints = ((List<MDRestrictionCodePropertyType> ) strategy.merge(LocatorUtils.property(leftLocator, "useConstraints", lhsUseConstraints), LocatorUtils.property(rightLocator, "useConstraints", rhsUseConstraints), lhsUseConstraints, rhsUseConstraints, leftObject.isSetUseConstraints(), rightObject.isSetUseConstraints()));
target.unsetUseConstraints();
if (mergedUseConstraints!= null) {
List<MDRestrictionCodePropertyType> uniqueUseConstraintsl = target.getUseConstraints();
uniqueUseConstraintsl.addAll(mergedUseConstraints);
}
} else {
if (useConstraintsShouldBeMergedAndSet == Boolean.FALSE) {
target.unsetUseConstraints();
}
}
}
{
Boolean otherConstraintsShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetOtherConstraints(), rightObject.isSetOtherConstraints());
if (otherConstraintsShouldBeMergedAndSet == Boolean.TRUE) {
List<CharacterStringPropertyType> lhsOtherConstraints;
lhsOtherConstraints = (leftObject.isSetOtherConstraints()?leftObject.getOtherConstraints():null);
List<CharacterStringPropertyType> rhsOtherConstraints;
rhsOtherConstraints = (rightObject.isSetOtherConstraints()?rightObject.getOtherConstraints():null);
List<CharacterStringPropertyType> mergedOtherConstraints = ((List<CharacterStringPropertyType> ) strategy.merge(LocatorUtils.property(leftLocator, "otherConstraints", lhsOtherConstraints), LocatorUtils.property(rightLocator, "otherConstraints", rhsOtherConstraints), lhsOtherConstraints, rhsOtherConstraints, leftObject.isSetOtherConstraints(), rightObject.isSetOtherConstraints()));
target.unsetOtherConstraints();
if (mergedOtherConstraints!= null) {
List<CharacterStringPropertyType> uniqueOtherConstraintsl = target.getOtherConstraints();
uniqueOtherConstraintsl.addAll(mergedOtherConstraints);
}
} else {
if (otherConstraintsShouldBeMergedAndSet == Boolean.FALSE) {
target.unsetOtherConstraints();
}
}
}
}
}
public void setAccessConstraints(List<MDRestrictionCodePropertyType> value) {
this.accessConstraints = null;
if (value!= null) {
List<MDRestrictionCodePropertyType> draftl = this.getAccessConstraints();
draftl.addAll(value);
}
}
public void setUseConstraints(List<MDRestrictionCodePropertyType> value) {
this.useConstraints = null;
if (value!= null) {
List<MDRestrictionCodePropertyType> draftl = this.getUseConstraints();
draftl.addAll(value);
}
}
public void setOtherConstraints(List<CharacterStringPropertyType> value) {
this.otherConstraints = null;
if (value!= null) {
List<CharacterStringPropertyType> draftl = this.getOtherConstraints();
draftl.addAll(value);
}
}
}