All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.somda.sdc.biceps.model.message.TimeFrame Maven / Gradle / Ivy


package org.somda.sdc.biceps.model.message;

import java.time.Instant;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb.lang.CopyStrategy;
import org.jvnet.jaxb.lang.CopyTo;
import org.jvnet.jaxb.lang.JAXBCopyStrategy;
import org.jvnet.jaxb.lang.JAXBToStringStrategy;
import org.jvnet.jaxb.lang.ToString;
import org.jvnet.jaxb.lang.ToStringStrategy;
import org.jvnet.jaxb.locator.ObjectLocator;
import org.jvnet.jaxb.locator.util.LocatorUtils;
import org.somda.sdc.common.model.TimestampAdapter;


/**
 * TimeFrame constitutes a time frame by defining ./@Start and ./@End, whereby ./@Start is REQUIRED to be lesser than ./@End.
 * 
 * 

Java class for TimeFrame complex type

. * *

The following schema fragment specifies the expected content contained within this class.

* *
{@code
 * 
 *   
 *     
 *       
 *       
 *     
 *   
 * 
 * }
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TimeFrame", namespace = "http://standards.ieee.org/downloads/11073/11073-10207-2017/message") public class TimeFrame implements Cloneable, CopyTo, ToString { /** * The start time of the time frame. * */ @XmlAttribute(name = "Start") @XmlJavaTypeAdapter(TimestampAdapter.class) protected Instant start; /** * The end time of the time frame. * */ @XmlAttribute(name = "End") @XmlJavaTypeAdapter(TimestampAdapter.class) protected Instant end; /** * The start time of the time frame. * * @return * possible object is * {@link String } * */ public Instant getStart() { return start; } /** * Sets the value of the start property. * * @param value * allowed object is * {@link String } * * @see #getStart() */ public void setStart(Instant value) { this.start = value; } /** * The end time of the time frame. * * @return * possible object is * {@link String } * */ public Instant getEnd() { return end; } /** * Sets the value of the end property. * * @param value * allowed object is * {@link String } * * @see #getEnd() */ public void setEnd(Instant value) { this.end = value; } @Override public boolean equals(Object object) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final TimeFrame that = ((TimeFrame) object); { Instant leftStart; leftStart = this.getStart(); Instant rightStart; rightStart = that.getStart(); if (this.start!= null) { if (that.start!= null) { if (!leftStart.equals(rightStart)) { return false; } } else { return false; } } else { if (that.start!= null) { return false; } } } { Instant leftEnd; leftEnd = this.getEnd(); Instant rightEnd; rightEnd = that.getEnd(); if (this.end!= null) { if (that.end!= null) { if (!leftEnd.equals(rightEnd)) { return false; } } else { return false; } } else { if (that.end!= null) { return false; } } } return true; } @Override public int hashCode() { int currentHashCode = 1; { currentHashCode = (currentHashCode* 31); Instant theStart; theStart = this.getStart(); if (this.start!= null) { currentHashCode += theStart.hashCode(); } } { currentHashCode = (currentHashCode* 31); Instant theEnd; theEnd = this.getEnd(); if (this.end!= null) { currentHashCode += theEnd.hashCode(); } } return currentHashCode; } @Override public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.getInstance(); final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } @Override public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } @Override public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { Instant theStart; theStart = this.getStart(); strategy.appendField(locator, this, "start", buffer, theStart, (this.start!= null)); } { Instant theEnd; theEnd = this.getEnd(); strategy.appendField(locator, this, "end", buffer, theEnd, (this.end!= null)); } return buffer; } @Override public Object clone() { return copyTo(createNewInstance()); } @Override public Object copyTo(Object target) { final CopyStrategy strategy = JAXBCopyStrategy.getInstance(); return copyTo(null, target, strategy); } @Override public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof TimeFrame) { final TimeFrame copy = ((TimeFrame) draftCopy); { Boolean startShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.start!= null)); if (startShouldBeCopiedAndSet == Boolean.TRUE) { Instant sourceStart; sourceStart = this.getStart(); Instant copyStart = ((Instant) strategy.copy(LocatorUtils.property(locator, "start", sourceStart), sourceStart, (this.start!= null))); copy.setStart(copyStart); } else { if (startShouldBeCopiedAndSet == Boolean.FALSE) { copy.start = null; } } } { Boolean endShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.end!= null)); if (endShouldBeCopiedAndSet == Boolean.TRUE) { Instant sourceEnd; sourceEnd = this.getEnd(); Instant copyEnd = ((Instant) strategy.copy(LocatorUtils.property(locator, "end", sourceEnd), sourceEnd, (this.end!= null))); copy.setEnd(copyEnd); } else { if (endShouldBeCopiedAndSet == Boolean.FALSE) { copy.end = null; } } } } return draftCopy; } @Override public Object createNewInstance() { return new TimeFrame(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy