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

org.jlab.jaws.entity.EffectiveAlarm Maven / Gradle / Ivy

/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package org.jlab.jaws.entity;

import org.apache.avro.generic.GenericArray;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.util.Utf8;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;

/** Processed alarm (notification + registration) */
@org.apache.avro.specific.AvroGenerated
public class EffectiveAlarm extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = 7007148408907600341L;


  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"EffectiveAlarm\",\"namespace\":\"org.jlab.jaws.entity\",\"doc\":\"Processed alarm (notification + registration)\",\"fields\":[{\"name\":\"registration\",\"type\":{\"type\":\"record\",\"name\":\"EffectiveRegistration\",\"doc\":\"Processed registration (instance + class)\",\"fields\":[{\"name\":\"instance\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"AlarmInstance\",\"doc\":\"Instance of an alarm class\",\"fields\":[{\"name\":\"alarmclass\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The alarm class; provides inheritable shared values\",\"default\":\"base\"},{\"name\":\"device\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"The name of the associated device\"},{\"name\":\"source\",\"type\":[{\"type\":\"record\",\"name\":\"Source\",\"doc\":\"Base registration with no specific source info\",\"fields\":[]},{\"type\":\"record\",\"name\":\"EPICSSource\",\"doc\":\"EPICS source registration\",\"fields\":[{\"name\":\"pv\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The name of the EPICS CA PV\"}]},{\"type\":\"record\",\"name\":\"CALCSource\",\"doc\":\"CALC Expression Alarm Generator source registration\",\"fields\":[{\"name\":\"expression\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The CALC expression used to generate alarms\"}]}],\"doc\":\"Provides source specific information via a union.\"},{\"name\":\"location\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"default\":[]},\"doc\":\"The locations associated with the alarm\"},{\"name\":\"maskedby\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"The name of the parent alarm, which if active, masks this alarm (flood suppression via logical hierarchy)\"},{\"name\":\"screencommand\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"The command to open the related control system screen\"}]}],\"doc\":\"The alarm instance\",\"default\":null},{\"name\":\"class\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"AlarmClass\",\"doc\":\"An alarm class\",\"fields\":[{\"name\":\"category\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The alarm category\"},{\"name\":\"priority\",\"type\":{\"type\":\"enum\",\"name\":\"AlarmPriority\",\"doc\":\"Enumeration of possible priorities; useful for operators to know which alarms to handle first\",\"symbols\":[\"P1_CRITICAL\",\"P2_MAJOR\",\"P3_MINOR\",\"P4_INCIDENTAL\"]},\"doc\":\"The alarm priority\"},{\"name\":\"rationale\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Markdown formatted text describing the reason this alarm is necessary\"},{\"name\":\"correctiveaction\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Markdown formatted text describing the corrective action to take when the alarm becomes active\"},{\"name\":\"pointofcontactusername\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Username (identifier) of point of contact.  Full contact info should be obtained from user database (LDAP for example)\"},{\"name\":\"latchable\",\"type\":\"boolean\",\"doc\":\"Indicates whether this alarm latches when activated and can only be cleared after an explicit acknowledgement\",\"default\":false},{\"name\":\"filterable\",\"type\":\"boolean\",\"doc\":\"Indicates whether this alarm can be filtered out of view (typically done when a portion of the machine is turned off).  Some alarms must always be monitored, regardless of program.\",\"default\":true},{\"name\":\"ondelayseconds\",\"type\":[\"null\",\"long\"],\"doc\":\"The number of seconds of on-delay\"},{\"name\":\"offdelayseconds\",\"type\":[\"null\",\"long\"],\"doc\":\"The number of seconds of off-delay\"}]}],\"doc\":\"The alarm class\",\"default\":null}]},\"doc\":\"The effective registration considering class and instance\"},{\"name\":\"notification\",\"type\":{\"type\":\"record\",\"name\":\"EffectiveNotification\",\"doc\":\"Processed notification (activation + overrides + state)\",\"fields\":[{\"name\":\"activation\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"AlarmActivationUnion\",\"doc\":\"An alarm activation\",\"fields\":[{\"name\":\"union\",\"type\":[{\"type\":\"record\",\"name\":\"Activation\",\"doc\":\"Alarming state for a simple alarm, if record is present then alarming, but there are no additional fields.\",\"fields\":[]},{\"type\":\"record\",\"name\":\"NoteActivation\",\"doc\":\"Alarming state for an alarm with an extra information string.\",\"fields\":[{\"name\":\"note\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The extra information about this active alarm\"}]},{\"type\":\"record\",\"name\":\"EPICSActivation\",\"doc\":\"EPICS alarming state.\",\"fields\":[{\"name\":\"sevr\",\"type\":{\"type\":\"enum\",\"name\":\"SevrEnum\",\"doc\":\"Enumeration of possible EPICS .SEVR values\",\"symbols\":[\"MINOR\",\"MAJOR\",\"INVALID\"]},\"doc\":\"Alarming state (EPICS .SEVR field)\"},{\"name\":\"stat\",\"type\":{\"type\":\"enum\",\"name\":\"StatEnum\",\"doc\":\"Enumeration of possible EPICS .STAT values\",\"symbols\":[\"NO_ALARM\",\"READ\",\"WRITE\",\"HIHI\",\"HIGH\",\"LOLO\",\"LOW\",\"STATE\",\"COS\",\"COMM\",\"TIMEOUT\",\"HW_LIMIT\",\"CALC\",\"SCAN\",\"LINK\",\"SOFT\",\"BAD_SUB\",\"UDF\",\"DISABLE\",\"SIMM\",\"READ_ACCESS\",\"WRITE_ACCESS\"]},\"doc\":\"Alarming status (EPICS .STAT field)\"}]},{\"type\":\"record\",\"name\":\"ChannelErrorActivation\",\"doc\":\"A channel error between JAWS and an alarm activation source.\",\"fields\":[{\"name\":\"error\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"Description of the error such as Never Connected or Disconnected\"}]},{\"type\":\"record\",\"name\":\"NoActivation\",\"doc\":\"An explicit no activation record can be aggressively compacted in Kafka (unlike a tombstone)\",\"fields\":[]}],\"doc\":\"Union of possible alarm activations.\"}]}],\"doc\":\"The alarm activation\",\"default\":null},{\"name\":\"overrides\",\"type\":{\"type\":\"record\",\"name\":\"AlarmOverrideSet\",\"doc\":\"Set of overrides for an alarm\",\"fields\":[{\"name\":\"disabled\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"DisabledOverride\",\"doc\":\"A disabled override\",\"fields\":[{\"name\":\"comments\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"Operator explanation\"}]}],\"doc\":\"A disabled override\",\"default\":null},{\"name\":\"filtered\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"FilteredOverride\",\"doc\":\"A filtered override\",\"fields\":[{\"name\":\"filtername\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"The name of the filter suppressing this alarm\"}]}],\"doc\":\"A filtered override\",\"default\":null},{\"name\":\"latched\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"LatchedOverride\",\"doc\":\"A latched override\",\"fields\":[]}],\"doc\":\"A latched override\",\"default\":null},{\"name\":\"masked\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"MaskedOverride\",\"doc\":\"A masked override\",\"fields\":[]}],\"doc\":\"A masked override\",\"default\":null},{\"name\":\"ondelayed\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"OnDelayedOverride\",\"doc\":\"An on-delayed override\",\"fields\":[{\"name\":\"expiration\",\"type\":\"long\",\"doc\":\"Unix timestamp of milliseconds since Epoch of Jan 1. 1970 - Timestamp denotes when this delayed alarm should expire\"}]}],\"doc\":\"An on-delayed override\",\"default\":null},{\"name\":\"offdelayed\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"OffDelayedOverride\",\"doc\":\"An off-delayed override\",\"fields\":[{\"name\":\"expiration\",\"type\":\"long\",\"doc\":\"Unix timestamp of milliseconds since Epoch of Jan 1. 1970 - Timestamp denotes when this delayed alarm should expire\"}]}],\"doc\":\"An off-delayed override\",\"default\":null},{\"name\":\"shelved\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"ShelvedOverride\",\"doc\":\"A temporarily suppressed alarm override\",\"fields\":[{\"name\":\"oneshot\",\"type\":\"boolean\",\"doc\":\"Indicates whether this shelved alarm unshelves when active; otherwise considered a continuous shelve and clears only upon expiration or manual operator intervention\",\"default\":false},{\"name\":\"expiration\",\"type\":\"long\",\"doc\":\"Unix timestamp of milliseconds since Epoch of Jan 1. 1970 - Timestamp denotes when this shelved alarm should expire\"},{\"name\":\"reason\",\"type\":{\"type\":\"enum\",\"name\":\"ShelvedReason\",\"doc\":\"Enumeration of possible reasons\",\"symbols\":[\"Stale_Alarm\",\"Chattering_Fleeting_Alarm\",\"Other\"]},\"doc\":\"Reason this alarm is shelved\"},{\"name\":\"comments\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"Operator explanation\"}]}],\"doc\":\"A shelved override\",\"default\":null}]},\"doc\":\"The alarm overrides\"},{\"name\":\"state\",\"type\":{\"type\":\"enum\",\"name\":\"AlarmState\",\"doc\":\"Enumeration of effective state an alarm can be in considering active, overrides, processing transitions, and override precedence\",\"symbols\":[\"Norma","lDisabled\",\"NormalFiltered\",\"NormalMasked\",\"NormalOnDelayed\",\"NormalOneShotShelved\",\"NormalContinuousShelved\",\"ActiveOffDelayed\",\"ActiveLatched\",\"Active\",\"Normal\"]},\"doc\":\"The calculated AlarmState considering activation and overrides\"}]},\"doc\":\"The effective notification considering overrides and activation\"}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }

  private static final SpecificData MODEL$ = new SpecificData();

  private static final BinaryMessageEncoder ENCODER =
      new BinaryMessageEncoder<>(MODEL$, SCHEMA$);

  private static final BinaryMessageDecoder DECODER =
      new BinaryMessageDecoder<>(MODEL$, SCHEMA$);

  /**
   * Return the BinaryMessageEncoder instance used by this class.
   * @return the message encoder used by this class
   */
  public static BinaryMessageEncoder getEncoder() {
    return ENCODER;
  }

  /**
   * Return the BinaryMessageDecoder instance used by this class.
   * @return the message decoder used by this class
   */
  public static BinaryMessageDecoder getDecoder() {
    return DECODER;
  }

  /**
   * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
   * @param resolver a {@link SchemaStore} used to find schemas by fingerprint
   * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore
   */
  public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
    return new BinaryMessageDecoder<>(MODEL$, SCHEMA$, resolver);
  }

  /**
   * Serializes this EffectiveAlarm to a ByteBuffer.
   * @return a buffer holding the serialized data for this instance
   * @throws java.io.IOException if this instance could not be serialized
   */
  public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
    return ENCODER.encode(this);
  }

  /**
   * Deserializes a EffectiveAlarm from a ByteBuffer.
   * @param b a byte buffer holding serialized data for an instance of this class
   * @return a EffectiveAlarm instance decoded from the given buffer
   * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class
   */
  public static EffectiveAlarm fromByteBuffer(
      java.nio.ByteBuffer b) throws java.io.IOException {
    return DECODER.decode(b);
  }

  /** The effective registration considering class and instance */
  private org.jlab.jaws.entity.EffectiveRegistration registration;
  /** The effective notification considering overrides and activation */
  private org.jlab.jaws.entity.EffectiveNotification notification;

  /**
   * Default constructor.  Note that this does not initialize fields
   * to their default values from the schema.  If that is desired then
   * one should use newBuilder().
   */
  public EffectiveAlarm() {}

  /**
   * All-args constructor.
   * @param registration The effective registration considering class and instance
   * @param notification The effective notification considering overrides and activation
   */
  public EffectiveAlarm(org.jlab.jaws.entity.EffectiveRegistration registration, org.jlab.jaws.entity.EffectiveNotification notification) {
    this.registration = registration;
    this.notification = notification;
  }

  @Override
  public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }

  @Override
  public org.apache.avro.Schema getSchema() { return SCHEMA$; }

  // Used by DatumWriter.  Applications should not call.
  @Override
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return registration;
    case 1: return notification;
    default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
    }
  }

  // Used by DatumReader.  Applications should not call.
  @Override
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: registration = (org.jlab.jaws.entity.EffectiveRegistration)value$; break;
    case 1: notification = (org.jlab.jaws.entity.EffectiveNotification)value$; break;
    default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
    }
  }

  /**
   * Gets the value of the 'registration' field.
   * @return The effective registration considering class and instance
   */
  public org.jlab.jaws.entity.EffectiveRegistration getRegistration() {
    return registration;
  }


  /**
   * Sets the value of the 'registration' field.
   * The effective registration considering class and instance
   * @param value the value to set.
   */
  public void setRegistration(org.jlab.jaws.entity.EffectiveRegistration value) {
    this.registration = value;
  }

  /**
   * Gets the value of the 'notification' field.
   * @return The effective notification considering overrides and activation
   */
  public org.jlab.jaws.entity.EffectiveNotification getNotification() {
    return notification;
  }


  /**
   * Sets the value of the 'notification' field.
   * The effective notification considering overrides and activation
   * @param value the value to set.
   */
  public void setNotification(org.jlab.jaws.entity.EffectiveNotification value) {
    this.notification = value;
  }

  /**
   * Creates a new EffectiveAlarm RecordBuilder.
   * @return A new EffectiveAlarm RecordBuilder
   */
  public static org.jlab.jaws.entity.EffectiveAlarm.Builder newBuilder() {
    return new org.jlab.jaws.entity.EffectiveAlarm.Builder();
  }

  /**
   * Creates a new EffectiveAlarm RecordBuilder by copying an existing Builder.
   * @param other The existing builder to copy.
   * @return A new EffectiveAlarm RecordBuilder
   */
  public static org.jlab.jaws.entity.EffectiveAlarm.Builder newBuilder(org.jlab.jaws.entity.EffectiveAlarm.Builder other) {
    if (other == null) {
      return new org.jlab.jaws.entity.EffectiveAlarm.Builder();
    } else {
      return new org.jlab.jaws.entity.EffectiveAlarm.Builder(other);
    }
  }

  /**
   * Creates a new EffectiveAlarm RecordBuilder by copying an existing EffectiveAlarm instance.
   * @param other The existing instance to copy.
   * @return A new EffectiveAlarm RecordBuilder
   */
  public static org.jlab.jaws.entity.EffectiveAlarm.Builder newBuilder(org.jlab.jaws.entity.EffectiveAlarm other) {
    if (other == null) {
      return new org.jlab.jaws.entity.EffectiveAlarm.Builder();
    } else {
      return new org.jlab.jaws.entity.EffectiveAlarm.Builder(other);
    }
  }

  /**
   * RecordBuilder for EffectiveAlarm instances.
   */
  @org.apache.avro.specific.AvroGenerated
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    /** The effective registration considering class and instance */
    private org.jlab.jaws.entity.EffectiveRegistration registration;
    private org.jlab.jaws.entity.EffectiveRegistration.Builder registrationBuilder;
    /** The effective notification considering overrides and activation */
    private org.jlab.jaws.entity.EffectiveNotification notification;
    private org.jlab.jaws.entity.EffectiveNotification.Builder notificationBuilder;

    /** Creates a new Builder */
    private Builder() {
      super(SCHEMA$, MODEL$);
    }

    /**
     * Creates a Builder by copying an existing Builder.
     * @param other The existing Builder to copy.
     */
    private Builder(org.jlab.jaws.entity.EffectiveAlarm.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.registration)) {
        this.registration = data().deepCopy(fields()[0].schema(), other.registration);
        fieldSetFlags()[0] = other.fieldSetFlags()[0];
      }
      if (other.hasRegistrationBuilder()) {
        this.registrationBuilder = org.jlab.jaws.entity.EffectiveRegistration.newBuilder(other.getRegistrationBuilder());
      }
      if (isValidValue(fields()[1], other.notification)) {
        this.notification = data().deepCopy(fields()[1].schema(), other.notification);
        fieldSetFlags()[1] = other.fieldSetFlags()[1];
      }
      if (other.hasNotificationBuilder()) {
        this.notificationBuilder = org.jlab.jaws.entity.EffectiveNotification.newBuilder(other.getNotificationBuilder());
      }
    }

    /**
     * Creates a Builder by copying an existing EffectiveAlarm instance
     * @param other The existing instance to copy.
     */
    private Builder(org.jlab.jaws.entity.EffectiveAlarm other) {
      super(SCHEMA$, MODEL$);
      if (isValidValue(fields()[0], other.registration)) {
        this.registration = data().deepCopy(fields()[0].schema(), other.registration);
        fieldSetFlags()[0] = true;
      }
      this.registrationBuilder = null;
      if (isValidValue(fields()[1], other.notification)) {
        this.notification = data().deepCopy(fields()[1].schema(), other.notification);
        fieldSetFlags()[1] = true;
      }
      this.notificationBuilder = null;
    }

    /**
      * Gets the value of the 'registration' field.
      * The effective registration considering class and instance
      * @return The value.
      */
    public org.jlab.jaws.entity.EffectiveRegistration getRegistration() {
      return registration;
    }


    /**
      * Sets the value of the 'registration' field.
      * The effective registration considering class and instance
      * @param value The value of 'registration'.
      * @return This builder.
      */
    public org.jlab.jaws.entity.EffectiveAlarm.Builder setRegistration(org.jlab.jaws.entity.EffectiveRegistration value) {
      validate(fields()[0], value);
      this.registrationBuilder = null;
      this.registration = value;
      fieldSetFlags()[0] = true;
      return this;
    }

    /**
      * Checks whether the 'registration' field has been set.
      * The effective registration considering class and instance
      * @return True if the 'registration' field has been set, false otherwise.
      */
    public boolean hasRegistration() {
      return fieldSetFlags()[0];
    }

    /**
     * Gets the Builder instance for the 'registration' field and creates one if it doesn't exist yet.
     * The effective registration considering class and instance
     * @return This builder.
     */
    public org.jlab.jaws.entity.EffectiveRegistration.Builder getRegistrationBuilder() {
      if (registrationBuilder == null) {
        if (hasRegistration()) {
          setRegistrationBuilder(org.jlab.jaws.entity.EffectiveRegistration.newBuilder(registration));
        } else {
          setRegistrationBuilder(org.jlab.jaws.entity.EffectiveRegistration.newBuilder());
        }
      }
      return registrationBuilder;
    }

    /**
     * Sets the Builder instance for the 'registration' field
     * The effective registration considering class and instance
     * @param value The builder instance that must be set.
     * @return This builder.
     */

    public org.jlab.jaws.entity.EffectiveAlarm.Builder setRegistrationBuilder(org.jlab.jaws.entity.EffectiveRegistration.Builder value) {
      clearRegistration();
      registrationBuilder = value;
      return this;
    }

    /**
     * Checks whether the 'registration' field has an active Builder instance
     * The effective registration considering class and instance
     * @return True if the 'registration' field has an active Builder instance
     */
    public boolean hasRegistrationBuilder() {
      return registrationBuilder != null;
    }

    /**
      * Clears the value of the 'registration' field.
      * The effective registration considering class and instance
      * @return This builder.
      */
    public org.jlab.jaws.entity.EffectiveAlarm.Builder clearRegistration() {
      registration = null;
      registrationBuilder = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /**
      * Gets the value of the 'notification' field.
      * The effective notification considering overrides and activation
      * @return The value.
      */
    public org.jlab.jaws.entity.EffectiveNotification getNotification() {
      return notification;
    }


    /**
      * Sets the value of the 'notification' field.
      * The effective notification considering overrides and activation
      * @param value The value of 'notification'.
      * @return This builder.
      */
    public org.jlab.jaws.entity.EffectiveAlarm.Builder setNotification(org.jlab.jaws.entity.EffectiveNotification value) {
      validate(fields()[1], value);
      this.notificationBuilder = null;
      this.notification = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /**
      * Checks whether the 'notification' field has been set.
      * The effective notification considering overrides and activation
      * @return True if the 'notification' field has been set, false otherwise.
      */
    public boolean hasNotification() {
      return fieldSetFlags()[1];
    }

    /**
     * Gets the Builder instance for the 'notification' field and creates one if it doesn't exist yet.
     * The effective notification considering overrides and activation
     * @return This builder.
     */
    public org.jlab.jaws.entity.EffectiveNotification.Builder getNotificationBuilder() {
      if (notificationBuilder == null) {
        if (hasNotification()) {
          setNotificationBuilder(org.jlab.jaws.entity.EffectiveNotification.newBuilder(notification));
        } else {
          setNotificationBuilder(org.jlab.jaws.entity.EffectiveNotification.newBuilder());
        }
      }
      return notificationBuilder;
    }

    /**
     * Sets the Builder instance for the 'notification' field
     * The effective notification considering overrides and activation
     * @param value The builder instance that must be set.
     * @return This builder.
     */

    public org.jlab.jaws.entity.EffectiveAlarm.Builder setNotificationBuilder(org.jlab.jaws.entity.EffectiveNotification.Builder value) {
      clearNotification();
      notificationBuilder = value;
      return this;
    }

    /**
     * Checks whether the 'notification' field has an active Builder instance
     * The effective notification considering overrides and activation
     * @return True if the 'notification' field has an active Builder instance
     */
    public boolean hasNotificationBuilder() {
      return notificationBuilder != null;
    }

    /**
      * Clears the value of the 'notification' field.
      * The effective notification considering overrides and activation
      * @return This builder.
      */
    public org.jlab.jaws.entity.EffectiveAlarm.Builder clearNotification() {
      notification = null;
      notificationBuilder = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    @Override
    @SuppressWarnings("unchecked")
    public EffectiveAlarm build() {
      try {
        EffectiveAlarm record = new EffectiveAlarm();
        if (registrationBuilder != null) {
          try {
            record.registration = this.registrationBuilder.build();
          } catch (org.apache.avro.AvroMissingFieldException e) {
            e.addParentField(record.getSchema().getField("registration"));
            throw e;
          }
        } else {
          record.registration = fieldSetFlags()[0] ? this.registration : (org.jlab.jaws.entity.EffectiveRegistration) defaultValue(fields()[0]);
        }
        if (notificationBuilder != null) {
          try {
            record.notification = this.notificationBuilder.build();
          } catch (org.apache.avro.AvroMissingFieldException e) {
            e.addParentField(record.getSchema().getField("notification"));
            throw e;
          }
        } else {
          record.notification = fieldSetFlags()[1] ? this.notification : (org.jlab.jaws.entity.EffectiveNotification) defaultValue(fields()[1]);
        }
        return record;
      } catch (org.apache.avro.AvroMissingFieldException e) {
        throw e;
      } catch (java.lang.Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumWriter
    WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$);

  @Override public void writeExternal(java.io.ObjectOutput out)
    throws java.io.IOException {
    WRITER$.write(this, SpecificData.getEncoder(out));
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumReader
    READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$);

  @Override public void readExternal(java.io.ObjectInput in)
    throws java.io.IOException {
    READER$.read(this, SpecificData.getDecoder(in));
  }

}














© 2015 - 2025 Weber Informatics LLC | Privacy Policy