package org.opendaylight.controller.sal.core;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
* Describe a latency in picoseconds or multiple of its.
*/
@XmlRootElement
+@XmlAccessorType(XmlAccessType.NONE)
public class Latency extends Property {
private static final long serialVersionUID = 1L;
sb.append("]");
return sb.toString();
}
+
+ @Override
+ public String getStringValue() {
+ if (this.latencyValue == 0) {
+ return("UnKnown");
+ } else if (this.latencyValue < LATENCY1ns) {
+ return(this.latencyValue + "psec");
+ } else if (this.latencyValue < LATENCY1us) {
+ return(Long.toString(this.latencyValue / LATENCY1ns) + "nsec");
+ } else if (this.latencyValue < LATENCY1ms) {
+ return(Long.toString(this.latencyValue / LATENCY1us) + "usec");
+ } else if (this.latencyValue < LATENCY1s) {
+ return(Long.toString(this.latencyValue / LATENCY1ms) + "msec");
+ } else {
+ return Long.toString(this.latencyValue) + "sec";
+ }
+ }
}