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

gobblin.metrics.GobblinTrackingEvent Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package gobblin.metrics;  
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class GobblinTrackingEvent 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\":\"GobblinTrackingEvent\",\"namespace\":\"gobblin.metrics\",\"fields\":[{\"name\":\"timestamp\",\"type\":\"long\",\"doc\":\"Time at which event was created.\",\"default\":0},{\"name\":\"namespace\",\"type\":[{\"type\":\"string\",\"avro.java.string\":\"String\"},\"null\"],\"doc\":\"Namespace used for filtering of events.\"},{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Event name.\"},{\"name\":\"metadata\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"},\"doc\":\"Event metadata.\",\"default\":{}}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** Time at which event was created. */
  @Deprecated public long timestamp;
  /** Namespace used for filtering of events. */
  @Deprecated public java.lang.String namespace;
  /** Event name. */
  @Deprecated public java.lang.String name;
  /** Event metadata. */
  @Deprecated public java.util.Map metadata;

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

  /**
   * All-args constructor.
   */
  public GobblinTrackingEvent(java.lang.Long timestamp, java.lang.String namespace, java.lang.String name, java.util.Map metadata) {
    this.timestamp = timestamp;
    this.namespace = namespace;
    this.name = name;
    this.metadata = metadata;
  }

  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 timestamp;
    case 1: return namespace;
    case 2: return name;
    case 3: return metadata;
    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: timestamp = (java.lang.Long)value$; break;
    case 1: namespace = (java.lang.String)value$; break;
    case 2: name = (java.lang.String)value$; break;
    case 3: metadata = (java.util.Map)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'timestamp' field.
   * Time at which event was created.   */
  public java.lang.Long getTimestamp() {
    return timestamp;
  }

  /**
   * Sets the value of the 'timestamp' field.
   * Time at which event was created.   * @param value the value to set.
   */
  public void setTimestamp(java.lang.Long value) {
    this.timestamp = value;
  }

  /**
   * Gets the value of the 'namespace' field.
   * Namespace used for filtering of events.   */
  public java.lang.String getNamespace() {
    return namespace;
  }

  /**
   * Sets the value of the 'namespace' field.
   * Namespace used for filtering of events.   * @param value the value to set.
   */
  public void setNamespace(java.lang.String value) {
    this.namespace = value;
  }

  /**
   * Gets the value of the 'name' field.
   * Event name.   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Sets the value of the 'name' field.
   * Event name.   * @param value the value to set.
   */
  public void setName(java.lang.String value) {
    this.name = value;
  }

  /**
   * Gets the value of the 'metadata' field.
   * Event metadata.   */
  public java.util.Map getMetadata() {
    return metadata;
  }

  /**
   * Sets the value of the 'metadata' field.
   * Event metadata.   * @param value the value to set.
   */
  public void setMetadata(java.util.Map value) {
    this.metadata = value;
  }

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

    private long timestamp;
    private java.lang.String namespace;
    private java.lang.String name;
    private java.util.Map metadata;

    /** Creates a new Builder */
    private Builder() {
      super(gobblin.metrics.GobblinTrackingEvent.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(gobblin.metrics.GobblinTrackingEvent.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.timestamp)) {
        this.timestamp = data().deepCopy(fields()[0].schema(), other.timestamp);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.namespace)) {
        this.namespace = data().deepCopy(fields()[1].schema(), other.namespace);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.name)) {
        this.name = data().deepCopy(fields()[2].schema(), other.name);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.metadata)) {
        this.metadata = data().deepCopy(fields()[3].schema(), other.metadata);
        fieldSetFlags()[3] = true;
      }
    }
    
    /** Creates a Builder by copying an existing GobblinTrackingEvent instance */
    private Builder(gobblin.metrics.GobblinTrackingEvent other) {
            super(gobblin.metrics.GobblinTrackingEvent.SCHEMA$);
      if (isValidValue(fields()[0], other.timestamp)) {
        this.timestamp = data().deepCopy(fields()[0].schema(), other.timestamp);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.namespace)) {
        this.namespace = data().deepCopy(fields()[1].schema(), other.namespace);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.name)) {
        this.name = data().deepCopy(fields()[2].schema(), other.name);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.metadata)) {
        this.metadata = data().deepCopy(fields()[3].schema(), other.metadata);
        fieldSetFlags()[3] = true;
      }
    }

    /** Gets the value of the 'timestamp' field */
    public java.lang.Long getTimestamp() {
      return timestamp;
    }
    
    /** Sets the value of the 'timestamp' field */
    public gobblin.metrics.GobblinTrackingEvent.Builder setTimestamp(long value) {
      validate(fields()[0], value);
      this.timestamp = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'timestamp' field has been set */
    public boolean hasTimestamp() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'timestamp' field */
    public gobblin.metrics.GobblinTrackingEvent.Builder clearTimestamp() {
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'namespace' field */
    public java.lang.String getNamespace() {
      return namespace;
    }
    
    /** Sets the value of the 'namespace' field */
    public gobblin.metrics.GobblinTrackingEvent.Builder setNamespace(java.lang.String value) {
      validate(fields()[1], value);
      this.namespace = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'namespace' field has been set */
    public boolean hasNamespace() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'namespace' field */
    public gobblin.metrics.GobblinTrackingEvent.Builder clearNamespace() {
      namespace = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'name' field */
    public java.lang.String getName() {
      return name;
    }
    
    /** Sets the value of the 'name' field */
    public gobblin.metrics.GobblinTrackingEvent.Builder setName(java.lang.String value) {
      validate(fields()[2], value);
      this.name = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'name' field has been set */
    public boolean hasName() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'name' field */
    public gobblin.metrics.GobblinTrackingEvent.Builder clearName() {
      name = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'metadata' field */
    public java.util.Map getMetadata() {
      return metadata;
    }
    
    /** Sets the value of the 'metadata' field */
    public gobblin.metrics.GobblinTrackingEvent.Builder setMetadata(java.util.Map value) {
      validate(fields()[3], value);
      this.metadata = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'metadata' field has been set */
    public boolean hasMetadata() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'metadata' field */
    public gobblin.metrics.GobblinTrackingEvent.Builder clearMetadata() {
      metadata = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    @Override
    public GobblinTrackingEvent build() {
      try {
        GobblinTrackingEvent record = new GobblinTrackingEvent();
        record.timestamp = fieldSetFlags()[0] ? this.timestamp : (java.lang.Long) defaultValue(fields()[0]);
        record.namespace = fieldSetFlags()[1] ? this.namespace : (java.lang.String) defaultValue(fields()[1]);
        record.name = fieldSetFlags()[2] ? this.name : (java.lang.String) defaultValue(fields()[2]);
        record.metadata = fieldSetFlags()[3] ? this.metadata : (java.util.Map) defaultValue(fields()[3]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy