//
// 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.08.02 at 09:23:15 PM EDT
//
package net.di2e.jaxb.cdr.describe.cc;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
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;
import org.w3c.dom.Element;
/**
* <p>Java class for MetricsType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MetricsType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="count" type="{http://www.w3.org/2001/XMLSchema}int"/>
* <element name="recordRate" type="{urn:cdr-ex:describe:cc:1.0}RecordRateType" minOccurs="0"/>
* <any processContents='lax' namespace='##other' maxOccurs="100" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MetricsType", propOrder = {
"count",
"recordRate",
"any"
})
public class MetricsType implements Serializable, Cloneable, CopyTo2, Equals2, HashCode2, MergeFrom2, ToString2
{
private final static long serialVersionUID = 1L;
@NotNull(message = "MetricsType.count {javax.validation.constraints.NotNull.message}")
protected long count;
@Valid
protected RecordRateType recordRate;
@XmlAnyElement(lax = true)
protected List<Object> any;
/**
* Gets the value of the count property.
*
*/
public long getCount() {
return count;
}
/**
* Sets the value of the count property.
*
*/
public void setCount(long value) {
this.count = value;
}
public boolean isSetCount() {
return true;
}
/**
* Gets the value of the recordRate property.
*
* @return
* possible object is
* {@link RecordRateType }
*
*/
public RecordRateType getRecordRate() {
return recordRate;
}
/**
* Sets the value of the recordRate property.
*
* @param value
* allowed object is
* {@link RecordRateType }
*
*/
public void setRecordRate(RecordRateType value) {
this.recordRate = value;
}
public boolean isSetRecordRate() {
return (this.recordRate!= null);
}
/**
* Gets the value of the any 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 any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
public boolean isSetAny() {
return ((this.any!= null)&&(!this.any.isEmpty()));
}
public void unsetAny() {
this.any = 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) {
{
long theCount;
theCount = this.getCount();
strategy.appendField(locator, this, "count", buffer, theCount, true);
}
{
RecordRateType theRecordRate;
theRecordRate = this.getRecordRate();
strategy.appendField(locator, this, "recordRate", buffer, theRecordRate, this.isSetRecordRate());
}
{
List<Object> theAny;
theAny = (this.isSetAny()?this.getAny():null);
strategy.appendField(locator, this, "any", buffer, theAny, this.isSetAny());
}
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 MetricsType that = ((MetricsType) object);
{
long lhsCount;
lhsCount = this.getCount();
long rhsCount;
rhsCount = that.getCount();
if (!strategy.equals(LocatorUtils.property(thisLocator, "count", lhsCount), LocatorUtils.property(thatLocator, "count", rhsCount), lhsCount, rhsCount, true, true)) {
return false;
}
}
{
RecordRateType lhsRecordRate;
lhsRecordRate = this.getRecordRate();
RecordRateType rhsRecordRate;
rhsRecordRate = that.getRecordRate();
if (!strategy.equals(LocatorUtils.property(thisLocator, "recordRate", lhsRecordRate), LocatorUtils.property(thatLocator, "recordRate", rhsRecordRate), lhsRecordRate, rhsRecordRate, this.isSetRecordRate(), that.isSetRecordRate())) {
return false;
}
}
{
List<Object> lhsAny;
lhsAny = (this.isSetAny()?this.getAny():null);
List<Object> rhsAny;
rhsAny = (that.isSetAny()?that.getAny():null);
if (!strategy.equals(LocatorUtils.property(thisLocator, "any", lhsAny), LocatorUtils.property(thatLocator, "any", rhsAny), lhsAny, rhsAny, this.isSetAny(), that.isSetAny())) {
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;
{
long theCount;
theCount = this.getCount();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "count", theCount), currentHashCode, theCount, true);
}
{
RecordRateType theRecordRate;
theRecordRate = this.getRecordRate();
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "recordRate", theRecordRate), currentHashCode, theRecordRate, this.isSetRecordRate());
}
{
List<Object> theAny;
theAny = (this.isSetAny()?this.getAny():null);
currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "any", theAny), currentHashCode, theAny, this.isSetAny());
}
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 MetricsType) {
final MetricsType copy = ((MetricsType) draftCopy);
{
Boolean countShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, true);
if (countShouldBeCopiedAndSet == Boolean.TRUE) {
long sourceCount;
sourceCount = this.getCount();
long copyCount = strategy.copy(LocatorUtils.property(locator, "count", sourceCount), sourceCount, true);
copy.setCount(copyCount);
} else {
if (countShouldBeCopiedAndSet == Boolean.FALSE) {
}
}
}
{
Boolean recordRateShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetRecordRate());
if (recordRateShouldBeCopiedAndSet == Boolean.TRUE) {
RecordRateType sourceRecordRate;
sourceRecordRate = this.getRecordRate();
RecordRateType copyRecordRate = ((RecordRateType) strategy.copy(LocatorUtils.property(locator, "recordRate", sourceRecordRate), sourceRecordRate, this.isSetRecordRate()));
copy.setRecordRate(copyRecordRate);
} else {
if (recordRateShouldBeCopiedAndSet == Boolean.FALSE) {
copy.recordRate = null;
}
}
}
{
Boolean anyShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, this.isSetAny());
if (anyShouldBeCopiedAndSet == Boolean.TRUE) {
List<Object> sourceAny;
sourceAny = (this.isSetAny()?this.getAny():null);
@SuppressWarnings("unchecked")
List<Object> copyAny = ((List<Object> ) strategy.copy(LocatorUtils.property(locator, "any", sourceAny), sourceAny, this.isSetAny()));
copy.unsetAny();
if (copyAny!= null) {
List<Object> uniqueAnyl = copy.getAny();
uniqueAnyl.addAll(copyAny);
}
} else {
if (anyShouldBeCopiedAndSet == Boolean.FALSE) {
copy.unsetAny();
}
}
}
}
return draftCopy;
}
public Object createNewInstance() {
return new MetricsType();
}
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 MetricsType) {
final MetricsType target = this;
final MetricsType leftObject = ((MetricsType) left);
final MetricsType rightObject = ((MetricsType) right);
{
Boolean countShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, true, true);
if (countShouldBeMergedAndSet == Boolean.TRUE) {
long lhsCount;
lhsCount = leftObject.getCount();
long rhsCount;
rhsCount = rightObject.getCount();
long mergedCount = ((int) strategy.merge(LocatorUtils.property(leftLocator, "count", lhsCount), LocatorUtils.property(rightLocator, "count", rhsCount), lhsCount, rhsCount, true, true));
target.setCount(mergedCount);
} else {
if (countShouldBeMergedAndSet == Boolean.FALSE) {
}
}
}
{
Boolean recordRateShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetRecordRate(), rightObject.isSetRecordRate());
if (recordRateShouldBeMergedAndSet == Boolean.TRUE) {
RecordRateType lhsRecordRate;
lhsRecordRate = leftObject.getRecordRate();
RecordRateType rhsRecordRate;
rhsRecordRate = rightObject.getRecordRate();
RecordRateType mergedRecordRate = ((RecordRateType) strategy.merge(LocatorUtils.property(leftLocator, "recordRate", lhsRecordRate), LocatorUtils.property(rightLocator, "recordRate", rhsRecordRate), lhsRecordRate, rhsRecordRate, leftObject.isSetRecordRate(), rightObject.isSetRecordRate()));
target.setRecordRate(mergedRecordRate);
} else {
if (recordRateShouldBeMergedAndSet == Boolean.FALSE) {
target.recordRate = null;
}
}
}
{
Boolean anyShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, leftObject.isSetAny(), rightObject.isSetAny());
if (anyShouldBeMergedAndSet == Boolean.TRUE) {
List<Object> lhsAny;
lhsAny = (leftObject.isSetAny()?leftObject.getAny():null);
List<Object> rhsAny;
rhsAny = (rightObject.isSetAny()?rightObject.getAny():null);
List<Object> mergedAny = ((List<Object> ) strategy.merge(LocatorUtils.property(leftLocator, "any", lhsAny), LocatorUtils.property(rightLocator, "any", rhsAny), lhsAny, rhsAny, leftObject.isSetAny(), rightObject.isSetAny()));
target.unsetAny();
if (mergedAny!= null) {
List<Object> uniqueAnyl = target.getAny();
uniqueAnyl.addAll(mergedAny);
}
} else {
if (anyShouldBeMergedAndSet == Boolean.FALSE) {
target.unsetAny();
}
}
}
}
}
public void setAny(List<Object> value) {
this.any = null;
if (value!= null) {
List<Object> draftl = this.getAny();
draftl.addAll(value);
}
}
}