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

org.gel.models.participant.avro.ConsentStatus Maven / Gradle / Ivy

/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.gel.models.participant.avro;  
@SuppressWarnings("all")
/** Consent Status for 100k program */
@org.apache.avro.specific.AvroGenerated
public class ConsentStatus extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ConsentStatus\",\"namespace\":\"org.gel.models.participant.avro\",\"doc\":\"Consent Status for 100k program\",\"fields\":[{\"name\":\"programmeConsent\",\"type\":\"boolean\",\"doc\":\"Is this individual consented to the programme?\\n        It could simply be a family member that is not consented but for whom affection status is known\",\"default\":false},{\"name\":\"primaryFindingConsent\",\"type\":\"boolean\",\"doc\":\"Consent for feedback of primary findings?\",\"default\":false},{\"name\":\"secondaryFindingConsent\",\"type\":\"boolean\",\"doc\":\"Consent for secondary finding lookup\",\"default\":false},{\"name\":\"carrierStatusConsent\",\"type\":\"boolean\",\"doc\":\"Consent for carrier status check?\",\"default\":false}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** Is this individual consented to the programme?
        It could simply be a family member that is not consented but for whom affection status is known */
   private boolean programmeConsent;
  /** Consent for feedback of primary findings? */
   private boolean primaryFindingConsent;
  /** Consent for secondary finding lookup */
   private boolean secondaryFindingConsent;
  /** Consent for carrier status check? */
   private boolean carrierStatusConsent;

  /**
   * 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 ConsentStatus() {}

  /**
   * All-args constructor.
   */
  public ConsentStatus(java.lang.Boolean programmeConsent, java.lang.Boolean primaryFindingConsent, java.lang.Boolean secondaryFindingConsent, java.lang.Boolean carrierStatusConsent) {
    this.programmeConsent = programmeConsent;
    this.primaryFindingConsent = primaryFindingConsent;
    this.secondaryFindingConsent = secondaryFindingConsent;
    this.carrierStatusConsent = carrierStatusConsent;
  }

  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call. 
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return programmeConsent;
    case 1: return primaryFindingConsent;
    case 2: return secondaryFindingConsent;
    case 3: return carrierStatusConsent;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }
  // Used by DatumReader.  Applications should not call. 
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: programmeConsent = (java.lang.Boolean)value$; break;
    case 1: primaryFindingConsent = (java.lang.Boolean)value$; break;
    case 2: secondaryFindingConsent = (java.lang.Boolean)value$; break;
    case 3: carrierStatusConsent = (java.lang.Boolean)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'programmeConsent' field.
   * Is this individual consented to the programme?
        It could simply be a family member that is not consented but for whom affection status is known   */
  public java.lang.Boolean getProgrammeConsent() {
    return programmeConsent;
  }

  /**
   * Sets the value of the 'programmeConsent' field.
   * Is this individual consented to the programme?
        It could simply be a family member that is not consented but for whom affection status is known   * @param value the value to set.
   */
  public void setProgrammeConsent(java.lang.Boolean value) {
    this.programmeConsent = value;
  }

  /**
   * Gets the value of the 'primaryFindingConsent' field.
   * Consent for feedback of primary findings?   */
  public java.lang.Boolean getPrimaryFindingConsent() {
    return primaryFindingConsent;
  }

  /**
   * Sets the value of the 'primaryFindingConsent' field.
   * Consent for feedback of primary findings?   * @param value the value to set.
   */
  public void setPrimaryFindingConsent(java.lang.Boolean value) {
    this.primaryFindingConsent = value;
  }

  /**
   * Gets the value of the 'secondaryFindingConsent' field.
   * Consent for secondary finding lookup   */
  public java.lang.Boolean getSecondaryFindingConsent() {
    return secondaryFindingConsent;
  }

  /**
   * Sets the value of the 'secondaryFindingConsent' field.
   * Consent for secondary finding lookup   * @param value the value to set.
   */
  public void setSecondaryFindingConsent(java.lang.Boolean value) {
    this.secondaryFindingConsent = value;
  }

  /**
   * Gets the value of the 'carrierStatusConsent' field.
   * Consent for carrier status check?   */
  public java.lang.Boolean getCarrierStatusConsent() {
    return carrierStatusConsent;
  }

  /**
   * Sets the value of the 'carrierStatusConsent' field.
   * Consent for carrier status check?   * @param value the value to set.
   */
  public void setCarrierStatusConsent(java.lang.Boolean value) {
    this.carrierStatusConsent = value;
  }

  /** Creates a new ConsentStatus RecordBuilder */
  public static org.gel.models.participant.avro.ConsentStatus.Builder newBuilder() {
    return new org.gel.models.participant.avro.ConsentStatus.Builder();
  }
  
  /** Creates a new ConsentStatus RecordBuilder by copying an existing Builder */
  public static org.gel.models.participant.avro.ConsentStatus.Builder newBuilder(org.gel.models.participant.avro.ConsentStatus.Builder other) {
    return new org.gel.models.participant.avro.ConsentStatus.Builder(other);
  }
  
  /** Creates a new ConsentStatus RecordBuilder by copying an existing ConsentStatus instance */
  public static org.gel.models.participant.avro.ConsentStatus.Builder newBuilder(org.gel.models.participant.avro.ConsentStatus other) {
    return new org.gel.models.participant.avro.ConsentStatus.Builder(other);
  }
  
  /**
   * RecordBuilder for ConsentStatus instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private boolean programmeConsent;
    private boolean primaryFindingConsent;
    private boolean secondaryFindingConsent;
    private boolean carrierStatusConsent;

    /** Creates a new Builder */
    private Builder() {
      super(org.gel.models.participant.avro.ConsentStatus.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.gel.models.participant.avro.ConsentStatus.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.programmeConsent)) {
        this.programmeConsent = data().deepCopy(fields()[0].schema(), other.programmeConsent);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.primaryFindingConsent)) {
        this.primaryFindingConsent = data().deepCopy(fields()[1].schema(), other.primaryFindingConsent);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.secondaryFindingConsent)) {
        this.secondaryFindingConsent = data().deepCopy(fields()[2].schema(), other.secondaryFindingConsent);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.carrierStatusConsent)) {
        this.carrierStatusConsent = data().deepCopy(fields()[3].schema(), other.carrierStatusConsent);
        fieldSetFlags()[3] = true;
      }
    }
    
    /** Creates a Builder by copying an existing ConsentStatus instance */
    private Builder(org.gel.models.participant.avro.ConsentStatus other) {
            super(org.gel.models.participant.avro.ConsentStatus.SCHEMA$);
      if (isValidValue(fields()[0], other.programmeConsent)) {
        this.programmeConsent = data().deepCopy(fields()[0].schema(), other.programmeConsent);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.primaryFindingConsent)) {
        this.primaryFindingConsent = data().deepCopy(fields()[1].schema(), other.primaryFindingConsent);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.secondaryFindingConsent)) {
        this.secondaryFindingConsent = data().deepCopy(fields()[2].schema(), other.secondaryFindingConsent);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.carrierStatusConsent)) {
        this.carrierStatusConsent = data().deepCopy(fields()[3].schema(), other.carrierStatusConsent);
        fieldSetFlags()[3] = true;
      }
    }

    /** Gets the value of the 'programmeConsent' field */
    public java.lang.Boolean getProgrammeConsent() {
      return programmeConsent;
    }
    
    /** Sets the value of the 'programmeConsent' field */
    public org.gel.models.participant.avro.ConsentStatus.Builder setProgrammeConsent(boolean value) {
      validate(fields()[0], value);
      this.programmeConsent = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'programmeConsent' field has been set */
    public boolean hasProgrammeConsent() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'programmeConsent' field */
    public org.gel.models.participant.avro.ConsentStatus.Builder clearProgrammeConsent() {
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'primaryFindingConsent' field */
    public java.lang.Boolean getPrimaryFindingConsent() {
      return primaryFindingConsent;
    }
    
    /** Sets the value of the 'primaryFindingConsent' field */
    public org.gel.models.participant.avro.ConsentStatus.Builder setPrimaryFindingConsent(boolean value) {
      validate(fields()[1], value);
      this.primaryFindingConsent = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'primaryFindingConsent' field has been set */
    public boolean hasPrimaryFindingConsent() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'primaryFindingConsent' field */
    public org.gel.models.participant.avro.ConsentStatus.Builder clearPrimaryFindingConsent() {
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'secondaryFindingConsent' field */
    public java.lang.Boolean getSecondaryFindingConsent() {
      return secondaryFindingConsent;
    }
    
    /** Sets the value of the 'secondaryFindingConsent' field */
    public org.gel.models.participant.avro.ConsentStatus.Builder setSecondaryFindingConsent(boolean value) {
      validate(fields()[2], value);
      this.secondaryFindingConsent = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'secondaryFindingConsent' field has been set */
    public boolean hasSecondaryFindingConsent() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'secondaryFindingConsent' field */
    public org.gel.models.participant.avro.ConsentStatus.Builder clearSecondaryFindingConsent() {
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'carrierStatusConsent' field */
    public java.lang.Boolean getCarrierStatusConsent() {
      return carrierStatusConsent;
    }
    
    /** Sets the value of the 'carrierStatusConsent' field */
    public org.gel.models.participant.avro.ConsentStatus.Builder setCarrierStatusConsent(boolean value) {
      validate(fields()[3], value);
      this.carrierStatusConsent = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'carrierStatusConsent' field has been set */
    public boolean hasCarrierStatusConsent() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'carrierStatusConsent' field */
    public org.gel.models.participant.avro.ConsentStatus.Builder clearCarrierStatusConsent() {
      fieldSetFlags()[3] = false;
      return this;
    }

    @Override
    public ConsentStatus build() {
      try {
        ConsentStatus record = new ConsentStatus();
        record.programmeConsent = fieldSetFlags()[0] ? this.programmeConsent : (java.lang.Boolean) defaultValue(fields()[0]);
        record.primaryFindingConsent = fieldSetFlags()[1] ? this.primaryFindingConsent : (java.lang.Boolean) defaultValue(fields()[1]);
        record.secondaryFindingConsent = fieldSetFlags()[2] ? this.secondaryFindingConsent : (java.lang.Boolean) defaultValue(fields()[2]);
        record.carrierStatusConsent = fieldSetFlags()[3] ? this.carrierStatusConsent : (java.lang.Boolean) defaultValue(fields()[3]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy