//
// 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 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;
/**
* <p>Java class for RS_Identifier_Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="RS_Identifier_Type">
* <complexContent>
* <extension base="{http://www.isotc211.org/2005/gmd}MD_Identifier_Type">
* <sequence>
* <element name="codeSpace" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* <element name="version" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RS_Identifier_Type", propOrder = {
"codeSpace",
"version"
})
public class RSIdentifierType
extends MDIdentifierType
implements Serializable, Cloneable, CopyTo2, Equals2, HashCode2, MergeFrom2, ToString2
{
private final static long serialVersionUID = 1L;
@Valid
protected CharacterStringPropertyType codeSpace;
@Valid
protected CharacterStringPropertyType version;
/**
* Gets the value of the codeSpace property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getCodeSpace() {
return codeSpace;
}
/**
* Sets the value of the codeSpace property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setCodeSpace(CharacterStringPropertyType value) {
this.codeSpace = value;
}
public boolean isSetCodeSpace() {
return (this.codeSpace!= null);
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getVersion() {
return version;
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setVersion(CharacterStringPropertyType value) {
this.version = value;
}
public boolean isSetVersion() {
return (this.version!= 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 theCodeSpace;
theCodeSpace = this.getCodeSpace();
strategy.appendField(locator, this, "codeSpace", buffer, theCodeSpace, this.isSetCodeSpace());
}
{
CharacterStringPropertyType theVersion;
theVersion = this.getVersion();
strategy.appendField(locator, this, "version", buffer, theVersion, this.isSetVersion());
}
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 RSIdentifierType that = ((RSIdentifierType) object);
{
CharacterStringPropertyType lhsCodeSpace;
lhsCodeSpace = this.getCodeSpace();
CharacterStringPropertyType rhsCodeSpace;
rhsCodeSpace = that.getCodeSpace();
if (!strategy.equals(LocatorUtils.property(thisLocator, "codeSpace", lhsCodeSpace), LocatorUtils.property(thatLocator, "codeSpace", rhsCodeSpace), lhsCodeSpace, rhsCodeSpace, this.isSetCodeSpace(), that.isSetCodeSpace())) {
return false;
}
}
{
CharacterStringPropertyType lhsVersion;
lhsVersion = this.getVersion();
CharacterStringPropertyType rhsVersion;
rhsVersion = that.getVersion();
if (!strategy.equals(LocatorUtils.property(thisLocator, "version", lhsVersion), LocatorUtils.property(thatLocator, "version", rhsVersion), lhsVersion, rhsVersion, this.isSetVersion(), that.isSetVersion())) {
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 theCodeSpace;
theCodeSpace = this.getCodeSpace();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "codeSpace", theCodeSpace), currentHashCode, theCodeSpace, this.isSetCodeSpace());
}
{
CharacterStringPropertyType theVersion;
theVersion = this.getVersion();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "version", theVersion), currentHashCode, theVersion, this.isSetVersion());
}
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 RSIdentifierType) {
final RSIdentifierType copy = ((RSIdentifierType) draftCopy);
{
Boolean codeSpaceShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetCodeSpace());
if (codeSpaceShouldBeCopiedAndSet == Boolean.TRUE) {
CharacterStringPropertyType sourceCodeSpace;
sourceCodeSpace = this.getCodeSpace();
CharacterStringPropertyType copyCodeSpace = ((CharacterStringPropertyType) strategy.copy(LocatorUtils.property(locator, "codeSpace", sourceCodeSpace), sourceCodeSpace, this.isSetCodeSpace()));
copy.setCodeSpace(copyCodeSpace);
} else {
if (codeSpaceShouldBeCopiedAndSet == Boolean.FALSE) {
copy.codeSpace = null;
}
}
}
{
Boolean versionShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetVersion());
if (versionShouldBeCopiedAndSet == Boolean.TRUE) {
CharacterStringPropertyType sourceVersion;
sourceVersion = this.getVersion();
CharacterStringPropertyType copyVersion = ((CharacterStringPropertyType) strategy.copy(LocatorUtils.property(locator, "version", sourceVersion), sourceVersion, this.isSetVersion()));
copy.setVersion(copyVersion);
} else {
if (versionShouldBeCopiedAndSet == Boolean.FALSE) {
copy.version = null;
}
}
}
}
return draftCopy;
}
public Object createNewInstance() {
return new RSIdentifierType();
}
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 RSIdentifierType) {
final RSIdentifierType target = this;
final RSIdentifierType leftObject = ((RSIdentifierType) left);
final RSIdentifierType rightObject = ((RSIdentifierType) right);
{
Boolean codeSpaceShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetCodeSpace(), rightObject.isSetCodeSpace());
if (codeSpaceShouldBeMergedAndSet == Boolean.TRUE) {
CharacterStringPropertyType lhsCodeSpace;
lhsCodeSpace = leftObject.getCodeSpace();
CharacterStringPropertyType rhsCodeSpace;
rhsCodeSpace = rightObject.getCodeSpace();
CharacterStringPropertyType mergedCodeSpace = ((CharacterStringPropertyType) strategy.merge(LocatorUtils.property(leftLocator, "codeSpace", lhsCodeSpace), LocatorUtils.property(rightLocator, "codeSpace", rhsCodeSpace), lhsCodeSpace, rhsCodeSpace, leftObject.isSetCodeSpace(), rightObject.isSetCodeSpace()));
target.setCodeSpace(mergedCodeSpace);
} else {
if (codeSpaceShouldBeMergedAndSet == Boolean.FALSE) {
target.codeSpace = null;
}
}
}
{
Boolean versionShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetVersion(), rightObject.isSetVersion());
if (versionShouldBeMergedAndSet == Boolean.TRUE) {
CharacterStringPropertyType lhsVersion;
lhsVersion = leftObject.getVersion();
CharacterStringPropertyType rhsVersion;
rhsVersion = rightObject.getVersion();
CharacterStringPropertyType mergedVersion = ((CharacterStringPropertyType) strategy.merge(LocatorUtils.property(leftLocator, "version", lhsVersion), LocatorUtils.property(rightLocator, "version", rhsVersion), lhsVersion, rhsVersion, leftObject.isSetVersion(), rightObject.isSetVersion()));
target.setVersion(mergedVersion);
} else {
if (versionShouldBeMergedAndSet == Boolean.FALSE) {
target.version = null;
}
}
}
}
}
}