/* 
 * Copyright 2015 Key Bridge LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package us.gov.dod.standard.ssrf._3_1.metadata.domains;

import java.util.Objects;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import us.gov.dod.standard.ssrf._3_1.adapter.types.XmlAdapterUS_DURATION;
import us.gov.dod.standard.ssrf._3_1.metadata.AMetadata;

/**
 * The SSRF US_Duration data type.
 * <p>
 * @author Key Bridge LLC <developer@keybridge.ch>
 * @version 3.1.0, 03/30/2015
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "US_Duration", propOrder = {"value"})
public class US_Duration extends AMetadata<US_Duration> implements Comparable<US_Duration> {

  /**
   * The value property.
   */
  @XmlValue
  @XmlJavaTypeAdapter(XmlAdapterUS_DURATION.class)
  protected String value;

  /**
   * Construct a new, empty US_Duration instance.
   */
  public US_Duration() {
  }

  /**
   * Construct a new US_Duration instance with the given initial value.
   * <p>
   * @param value The initial value.
   */
  public US_Duration(String value) {
    this.value = value;
  }

  /**
   * Get the value of the value property.
   * <p>
   * @return the value of the value property
   */
  public String getValue() {
    return value;
  }

  /**
   * Set the value of the value property.
   * <p>
   * @param the value
   */
  public void setValue(String value) {
    this.value = value;
  }

  /**
   * Determine if the value property is configured.
   * <p>
   * @return TRUE if the value is set, FALSE if the value is null
   */
  public boolean isSetValue() {
    return this.value != null;
  }

  /**
   * Determine if the required fields in this SSRF data type instance are set.
   * <p>
   * Note that this method only checks for the presence of required information;
   * this method does not validate the information format.
   * <p>
   * @return TRUE if required fields are set, otherwise FALSE
   */
  @Override
  public boolean isSet() {
    return super.isSet() && isSetValue();
  }

  /**
   * Get a string representation of this data wrapper value.
   * <p>
   * @return The current data value.
   */
  @Override
  public String toString() {
    return this.value;
  }

  //<editor-fold defaultstate="collapsed" desc="Hashcode Equals and Comparable">
  /**
   * Hash code is based upon the value.
   * <p>
   * @return a unique hash code from the value.
   */
  @Override
  public int hashCode() {
    int hash = 7;
    hash = 97 * hash + Objects.hashCode(this.value);
    return hash;
  }

  /**
   * Equality is based upon the value.
   * <p>
   * @param obj the other object to compare.
   * @return TRUE if the values match exactly.
   */
  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    return Objects.equals(this.value, ((US_Duration) obj).getValue());
  }

  /**
   * Comparison and sorting.
   * <p>
   * @param obj the other object to compare
   * @return the sorting order.
   */
  @Override
  public int compareTo(US_Duration obj) {
    if (obj == null) {
      return -1;
    }
    if (this.value == null) {
      return 1;
    }
    return this.value.compareTo(obj.getValue());
  }//</editor-fold>
}

@@ -1,11 +1,10 @@
 /*
- 
 %0A * Copy
@@ -1099,16 +1099,345 @@
 %0A * %3Cp%3E%0A
+ * TxDuration: In Data Item TxDuration (US) enter the amount of time that the%0A * equipment will emit a jamming signal, in (0-999) hours, (0-59) minutes, and%0A * (0-999,999,999) nanoseconds (hhh.mm.sssssssss).%0A * %3Cp%3E%0A * %5BXSD ERR REGEX%5D This data item MUST comply to the regular expression:%0A * %22%5B0-9%5D%7B3%7D.%5B0-5%5D%5B0-9%5D.%5B0-9%5D%7B9%7D%22%0A * %3Cp%3E%0A
  * @auth
@@ -1725,24 +1725,119 @@
 ue property.
+ Time in (0-999) hours, (0-59) minutes, and%0A   * (0-999,999,999) nanoseconds (hhh.mm.sssssssss)
 %0A   */%0A  @Xm

add doc'n