//
// 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.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.XmlType;
import org.isotc211._2005.gco.AbstractObjectType;
import org.isotc211._2005.gco.CharacterStringPropertyType;
import org.isotc211._2005.gco.DateTimePropertyType;
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;
/**
* Brief description of ways in which the dataset is currently used.
*
* <p>Java class for MD_Usage_Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MD_Usage_Type">
* <complexContent>
* <extension base="{http://www.isotc211.org/2005/gco}AbstractObject_Type">
* <sequence>
* <element name="specificUsage" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType"/>
* <element name="usageDateTime" type="{http://www.isotc211.org/2005/gco}DateTime_PropertyType" minOccurs="0"/>
* <element name="userDeterminedLimitations" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* <element name="userContactInfo" type="{http://www.isotc211.org/2005/gmd}CI_ResponsibleParty_PropertyType" maxOccurs="unbounded"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MD_Usage_Type", propOrder = {
"specificUsage",
"usageDateTime",
"userDeterminedLimitations",
"userContactInfo"
})
public class MDUsageType
extends AbstractObjectType
implements Serializable, Cloneable, CopyTo2, Equals2, HashCode2, MergeFrom2, ToString2
{
private final static long serialVersionUID = 1L;
@XmlElement(required = true)
@NotNull(message = "MDUsageType.specificUsage {javax.validation.constraints.NotNull.message}")
@Valid
protected CharacterStringPropertyType specificUsage;
@Valid
protected DateTimePropertyType usageDateTime;
@Valid
protected CharacterStringPropertyType userDeterminedLimitations;
@XmlElement(required = true)
@NotNull(message = "MDUsageType.userContactInfo {javax.validation.constraints.NotNull.message}")
@Size(min = 1)
@Valid
protected List<CIResponsiblePartyPropertyType> userContactInfo;
/**
* Gets the value of the specificUsage property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getSpecificUsage() {
return specificUsage;
}
/**
* Sets the value of the specificUsage property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setSpecificUsage(CharacterStringPropertyType value) {
this.specificUsage = value;
}
public boolean isSetSpecificUsage() {
return (this.specificUsage!= null);
}
/**
* Gets the value of the usageDateTime property.
*
* @return
* possible object is
* {@link DateTimePropertyType }
*
*/
public DateTimePropertyType getUsageDateTime() {
return usageDateTime;
}
/**
* Sets the value of the usageDateTime property.
*
* @param value
* allowed object is
* {@link DateTimePropertyType }
*
*/
public void setUsageDateTime(DateTimePropertyType value) {
this.usageDateTime = value;
}
public boolean isSetUsageDateTime() {
return (this.usageDateTime!= null);
}
/**
* Gets the value of the userDeterminedLimitations property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getUserDeterminedLimitations() {
return userDeterminedLimitations;
}
/**
* Sets the value of the userDeterminedLimitations property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setUserDeterminedLimitations(CharacterStringPropertyType value) {
this.userDeterminedLimitations = value;
}
public boolean isSetUserDeterminedLimitations() {
return (this.userDeterminedLimitations!= null);
}
/**
* Gets the value of the userContactInfo 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 userContactInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getUserContactInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CIResponsiblePartyPropertyType }
*
*
*/
public List<CIResponsiblePartyPropertyType> getUserContactInfo() {
if (userContactInfo == null) {
userContactInfo = new ArrayList<CIResponsiblePartyPropertyType>();
}
return this.userContactInfo;
}
public boolean isSetUserContactInfo() {
return ((this.userContactInfo!= null)&&(!this.userContactInfo.isEmpty()));
}
public void unsetUserContactInfo() {
this.userContactInfo = 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);
{
CharacterStringPropertyType theSpecificUsage;
theSpecificUsage = this.getSpecificUsage();
strategy.appendField(locator, this, "specificUsage", buffer, theSpecificUsage, this.isSetSpecificUsage());
}
{
DateTimePropertyType theUsageDateTime;
theUsageDateTime = this.getUsageDateTime();
strategy.appendField(locator, this, "usageDateTime", buffer, theUsageDateTime, this.isSetUsageDateTime());
}
{
CharacterStringPropertyType theUserDeterminedLimitations;
theUserDeterminedLimitations = this.getUserDeterminedLimitations();
strategy.appendField(locator, this, "userDeterminedLimitations", buffer, theUserDeterminedLimitations, this.isSetUserDeterminedLimitations());
}
{
List<CIResponsiblePartyPropertyType> theUserContactInfo;
theUserContactInfo = (this.isSetUserContactInfo()?this.getUserContactInfo():null);
strategy.appendField(locator, this, "userContactInfo", buffer, theUserContactInfo, this.isSetUserContactInfo());
}
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 MDUsageType that = ((MDUsageType) object);
{
CharacterStringPropertyType lhsSpecificUsage;
lhsSpecificUsage = this.getSpecificUsage();
CharacterStringPropertyType rhsSpecificUsage;
rhsSpecificUsage = that.getSpecificUsage();
if (!strategy.equals(LocatorUtils.property(thisLocator, "specificUsage", lhsSpecificUsage), LocatorUtils.property(thatLocator, "specificUsage", rhsSpecificUsage), lhsSpecificUsage, rhsSpecificUsage, this.isSetSpecificUsage(), that.isSetSpecificUsage())) {
return false;
}
}
{
DateTimePropertyType lhsUsageDateTime;
lhsUsageDateTime = this.getUsageDateTime();
DateTimePropertyType rhsUsageDateTime;
rhsUsageDateTime = that.getUsageDateTime();
if (!strategy.equals(LocatorUtils.property(thisLocator, "usageDateTime", lhsUsageDateTime), LocatorUtils.property(thatLocator, "usageDateTime", rhsUsageDateTime), lhsUsageDateTime, rhsUsageDateTime, this.isSetUsageDateTime(), that.isSetUsageDateTime())) {
return false;
}
}
{
CharacterStringPropertyType lhsUserDeterminedLimitations;
lhsUserDeterminedLimitations = this.getUserDeterminedLimitations();
CharacterStringPropertyType rhsUserDeterminedLimitations;
rhsUserDeterminedLimitations = that.getUserDeterminedLimitations();
if (!strategy.equals(LocatorUtils.property(thisLocator, "userDeterminedLimitations", lhsUserDeterminedLimitations), LocatorUtils.property(thatLocator, "userDeterminedLimitations", rhsUserDeterminedLimitations), lhsUserDeterminedLimitations, rhsUserDeterminedLimitations, this.isSetUserDeterminedLimitations(), that.isSetUserDeterminedLimitations())) {
return false;
}
}
{
List<CIResponsiblePartyPropertyType> lhsUserContactInfo;
lhsUserContactInfo = (this.isSetUserContactInfo()?this.getUserContactInfo():null);
List<CIResponsiblePartyPropertyType> rhsUserContactInfo;
rhsUserContactInfo = (that.isSetUserContactInfo()?that.getUserContactInfo():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "userContactInfo", lhsUserContactInfo), LocatorUtils.property(thatLocator, "userContactInfo", rhsUserContactInfo), lhsUserContactInfo, rhsUserContactInfo, this.isSetUserContactInfo(), that.isSetUserContactInfo())) {
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);
{
CharacterStringPropertyType theSpecificUsage;
theSpecificUsage = this.getSpecificUsage();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "specificUsage", theSpecificUsage), currentHashCode, theSpecificUsage, this.isSetSpecificUsage());
}
{
DateTimePropertyType theUsageDateTime;
theUsageDateTime = this.getUsageDateTime();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "usageDateTime", theUsageDateTime), currentHashCode, theUsageDateTime, this.isSetUsageDateTime());
}
{
CharacterStringPropertyType theUserDeterminedLimitations;
theUserDeterminedLimitations = this.getUserDeterminedLimitations();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "userDeterminedLimitations", theUserDeterminedLimitations), currentHashCode, theUserDeterminedLimitations, this.isSetUserDeterminedLimitations());
}
{
List<CIResponsiblePartyPropertyType> theUserContactInfo;
theUserContactInfo = (this.isSetUserContactInfo()?this.getUserContactInfo():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "userContactInfo", theUserContactInfo), currentHashCode, theUserContactInfo, this.isSetUserContactInfo());
}
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 MDUsageType) {
final MDUsageType copy = ((MDUsageType) draftCopy);
{
Boolean specificUsageShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetSpecificUsage());
if (specificUsageShouldBeCopiedAndSet == Boolean.TRUE) {
CharacterStringPropertyType sourceSpecificUsage;
sourceSpecificUsage = this.getSpecificUsage();
CharacterStringPropertyType copySpecificUsage = ((CharacterStringPropertyType) strategy.copy(LocatorUtils.property(locator, "specificUsage", sourceSpecificUsage), sourceSpecificUsage, this.isSetSpecificUsage()));
copy.setSpecificUsage(copySpecificUsage);
} else {
if (specificUsageShouldBeCopiedAndSet == Boolean.FALSE) {
copy.specificUsage = null;
}
}
}
{
Boolean usageDateTimeShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetUsageDateTime());
if (usageDateTimeShouldBeCopiedAndSet == Boolean.TRUE) {
DateTimePropertyType sourceUsageDateTime;
sourceUsageDateTime = this.getUsageDateTime();
DateTimePropertyType copyUsageDateTime = ((DateTimePropertyType) strategy.copy(LocatorUtils.property(locator, "usageDateTime", sourceUsageDateTime), sourceUsageDateTime, this.isSetUsageDateTime()));
copy.setUsageDateTime(copyUsageDateTime);
} else {
if (usageDateTimeShouldBeCopiedAndSet == Boolean.FALSE) {
copy.usageDateTime = null;
}
}
}
{
Boolean userDeterminedLimitationsShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetUserDeterminedLimitations());
if (userDeterminedLimitationsShouldBeCopiedAndSet == Boolean.TRUE) {
CharacterStringPropertyType sourceUserDeterminedLimitations;
sourceUserDeterminedLimitations = this.getUserDeterminedLimitations();
CharacterStringPropertyType copyUserDeterminedLimitations = ((CharacterStringPropertyType) strategy.copy(LocatorUtils.property(locator, "userDeterminedLimitations", sourceUserDeterminedLimitations), sourceUserDeterminedLimitations, this.isSetUserDeterminedLimitations()));
copy.setUserDeterminedLimitations(copyUserDeterminedLimitations);
} else {
if (userDeterminedLimitationsShouldBeCopiedAndSet == Boolean.FALSE) {
copy.userDeterminedLimitations = null;
}
}
}
{
Boolean userContactInfoShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetUserContactInfo());
if (userContactInfoShouldBeCopiedAndSet == Boolean.TRUE) {
List<CIResponsiblePartyPropertyType> sourceUserContactInfo;
sourceUserContactInfo = (this.isSetUserContactInfo()?this.getUserContactInfo():null);
@SuppressWarnings("unchecked")
List<CIResponsiblePartyPropertyType> copyUserContactInfo = ((List<CIResponsiblePartyPropertyType> ) strategy.copy(LocatorUtils.property(locator, "userContactInfo", sourceUserContactInfo), sourceUserContactInfo, this.isSetUserContactInfo()));
copy.unsetUserContactInfo();
if (copyUserContactInfo!= null) {
List<CIResponsiblePartyPropertyType> uniqueUserContactInfol = copy.getUserContactInfo();
uniqueUserContactInfol.addAll(copyUserContactInfo);
}
} else {
if (userContactInfoShouldBeCopiedAndSet == Boolean.FALSE) {
copy.unsetUserContactInfo();
}
}
}
}
return draftCopy;
}
public Object createNewInstance() {
return new MDUsageType();
}
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 MDUsageType) {
final MDUsageType target = this;
final MDUsageType leftObject = ((MDUsageType) left);
final MDUsageType rightObject = ((MDUsageType) right);
{
Boolean specificUsageShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetSpecificUsage(), rightObject.isSetSpecificUsage());
if (specificUsageShouldBeMergedAndSet == Boolean.TRUE) {
CharacterStringPropertyType lhsSpecificUsage;
lhsSpecificUsage = leftObject.getSpecificUsage();
CharacterStringPropertyType rhsSpecificUsage;
rhsSpecificUsage = rightObject.getSpecificUsage();
CharacterStringPropertyType mergedSpecificUsage = ((CharacterStringPropertyType) strategy.merge(LocatorUtils.property(leftLocator, "specificUsage", lhsSpecificUsage), LocatorUtils.property(rightLocator, "specificUsage", rhsSpecificUsage), lhsSpecificUsage, rhsSpecificUsage, leftObject.isSetSpecificUsage(), rightObject.isSetSpecificUsage()));
target.setSpecificUsage(mergedSpecificUsage);
} else {
if (specificUsageShouldBeMergedAndSet == Boolean.FALSE) {
target.specificUsage = null;
}
}
}
{
Boolean usageDateTimeShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetUsageDateTime(), rightObject.isSetUsageDateTime());
if (usageDateTimeShouldBeMergedAndSet == Boolean.TRUE) {
DateTimePropertyType lhsUsageDateTime;
lhsUsageDateTime = leftObject.getUsageDateTime();
DateTimePropertyType rhsUsageDateTime;
rhsUsageDateTime = rightObject.getUsageDateTime();
DateTimePropertyType mergedUsageDateTime = ((DateTimePropertyType) strategy.merge(LocatorUtils.property(leftLocator, "usageDateTime", lhsUsageDateTime), LocatorUtils.property(rightLocator, "usageDateTime", rhsUsageDateTime), lhsUsageDateTime, rhsUsageDateTime, leftObject.isSetUsageDateTime(), rightObject.isSetUsageDateTime()));
target.setUsageDateTime(mergedUsageDateTime);
} else {
if (usageDateTimeShouldBeMergedAndSet == Boolean.FALSE) {
target.usageDateTime = null;
}
}
}
{
Boolean userDeterminedLimitationsShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetUserDeterminedLimitations(), rightObject.isSetUserDeterminedLimitations());
if (userDeterminedLimitationsShouldBeMergedAndSet == Boolean.TRUE) {
CharacterStringPropertyType lhsUserDeterminedLimitations;
lhsUserDeterminedLimitations = leftObject.getUserDeterminedLimitations();
CharacterStringPropertyType rhsUserDeterminedLimitations;
rhsUserDeterminedLimitations = rightObject.getUserDeterminedLimitations();
CharacterStringPropertyType mergedUserDeterminedLimitations = ((CharacterStringPropertyType) strategy.merge(LocatorUtils.property(leftLocator, "userDeterminedLimitations", lhsUserDeterminedLimitations), LocatorUtils.property(rightLocator, "userDeterminedLimitations", rhsUserDeterminedLimitations), lhsUserDeterminedLimitations, rhsUserDeterminedLimitations, leftObject.isSetUserDeterminedLimitations(), rightObject.isSetUserDeterminedLimitations()));
target.setUserDeterminedLimitations(mergedUserDeterminedLimitations);
} else {
if (userDeterminedLimitationsShouldBeMergedAndSet == Boolean.FALSE) {
target.userDeterminedLimitations = null;
}
}
}
{
Boolean userContactInfoShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetUserContactInfo(), rightObject.isSetUserContactInfo());
if (userContactInfoShouldBeMergedAndSet == Boolean.TRUE) {
List<CIResponsiblePartyPropertyType> lhsUserContactInfo;
lhsUserContactInfo = (leftObject.isSetUserContactInfo()?leftObject.getUserContactInfo():null);
List<CIResponsiblePartyPropertyType> rhsUserContactInfo;
rhsUserContactInfo = (rightObject.isSetUserContactInfo()?rightObject.getUserContactInfo():null);
List<CIResponsiblePartyPropertyType> mergedUserContactInfo = ((List<CIResponsiblePartyPropertyType> ) strategy.merge(LocatorUtils.property(leftLocator, "userContactInfo", lhsUserContactInfo), LocatorUtils.property(rightLocator, "userContactInfo", rhsUserContactInfo), lhsUserContactInfo, rhsUserContactInfo, leftObject.isSetUserContactInfo(), rightObject.isSetUserContactInfo()));
target.unsetUserContactInfo();
if (mergedUserContactInfo!= null) {
List<CIResponsiblePartyPropertyType> uniqueUserContactInfol = target.getUserContactInfo();
uniqueUserContactInfol.addAll(mergedUserContactInfo);
}
} else {
if (userContactInfoShouldBeMergedAndSet == Boolean.FALSE) {
target.unsetUserContactInfo();
}
}
}
}
}
public void setUserContactInfo(List<CIResponsiblePartyPropertyType> value) {
this.userContactInfo = null;
if (value!= null) {
List<CIResponsiblePartyPropertyType> draftl = this.getUserContactInfo();
draftl.addAll(value);
}
}
}