This project has retired. For details please refer to its Attic page.
Source code
001/**
002 * Autogenerated by Avro
003 *
004 * DO NOT EDIT DIRECTLY
005 */
006package org.apache.reef.bridge.message;
007
008import org.apache.avro.specific.SpecificData;
009
010@SuppressWarnings("all")
011/** The SystemOnStart message is sent to the CLR bridge from the Java bridge when the round trip communication path has been established. */
012@org.apache.avro.specific.AvroGenerated
013public class SystemOnStart extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
014  private static final long serialVersionUID = -6431569212417510808L;
015  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"SystemOnStart\",\"namespace\":\"org.apache.reef.bridge.message\",\"doc\":\"The SystemOnStart message is sent to the CLR bridge from the Java bridge when the round trip communication path has been established.\",\"fields\":[{\"name\":\"dateTime\",\"type\":\"long\",\"doc\":\"Date time in seconds as a long since January 1, 1970\"}]}");
016  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
017  /** Date time in seconds as a long since January 1, 1970 */
018  @Deprecated public long dateTime;
019
020  /**
021   * Default constructor.  Note that this does not initialize fields
022   * to their default values from the schema.  If that is desired then
023   * one should use <code>newBuilder()</code>.
024   */
025  public SystemOnStart() {}
026
027  /**
028   * All-args constructor.
029   * @param dateTime Date time in seconds as a long since January 1, 1970
030   */
031  public SystemOnStart(java.lang.Long dateTime) {
032    this.dateTime = dateTime;
033  }
034
035  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
036  // Used by DatumWriter.  Applications should not call.
037  public java.lang.Object get(int field$) {
038    switch (field$) {
039    case 0: return dateTime;
040    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
041    }
042  }
043
044  // Used by DatumReader.  Applications should not call.
045  @SuppressWarnings(value="unchecked")
046  public void put(int field$, java.lang.Object value$) {
047    switch (field$) {
048    case 0: dateTime = (java.lang.Long)value$; break;
049    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
050    }
051  }
052
053  /**
054   * Gets the value of the 'dateTime' field.
055   * @return Date time in seconds as a long since January 1, 1970
056   */
057  public java.lang.Long getDateTime() {
058    return dateTime;
059  }
060
061  /**
062   * Sets the value of the 'dateTime' field.
063   * Date time in seconds as a long since January 1, 1970
064   * @param value the value to set.
065   */
066  public void setDateTime(java.lang.Long value) {
067    this.dateTime = value;
068  }
069
070  /**
071   * Creates a new SystemOnStart RecordBuilder.
072   * @return A new SystemOnStart RecordBuilder
073   */
074  public static org.apache.reef.bridge.message.SystemOnStart.Builder newBuilder() {
075    return new org.apache.reef.bridge.message.SystemOnStart.Builder();
076  }
077
078  /**
079   * Creates a new SystemOnStart RecordBuilder by copying an existing Builder.
080   * @param other The existing builder to copy.
081   * @return A new SystemOnStart RecordBuilder
082   */
083  public static org.apache.reef.bridge.message.SystemOnStart.Builder newBuilder(org.apache.reef.bridge.message.SystemOnStart.Builder other) {
084    return new org.apache.reef.bridge.message.SystemOnStart.Builder(other);
085  }
086
087  /**
088   * Creates a new SystemOnStart RecordBuilder by copying an existing SystemOnStart instance.
089   * @param other The existing instance to copy.
090   * @return A new SystemOnStart RecordBuilder
091   */
092  public static org.apache.reef.bridge.message.SystemOnStart.Builder newBuilder(org.apache.reef.bridge.message.SystemOnStart other) {
093    return new org.apache.reef.bridge.message.SystemOnStart.Builder(other);
094  }
095
096  /**
097   * RecordBuilder for SystemOnStart instances.
098   */
099  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<SystemOnStart>
100    implements org.apache.avro.data.RecordBuilder<SystemOnStart> {
101
102    /** Date time in seconds as a long since January 1, 1970 */
103    private long dateTime;
104
105    /** Creates a new Builder */
106    private Builder() {
107      super(SCHEMA$);
108    }
109
110    /**
111     * Creates a Builder by copying an existing Builder.
112     * @param other The existing Builder to copy.
113     */
114    private Builder(org.apache.reef.bridge.message.SystemOnStart.Builder other) {
115      super(other);
116      if (isValidValue(fields()[0], other.dateTime)) {
117        this.dateTime = data().deepCopy(fields()[0].schema(), other.dateTime);
118        fieldSetFlags()[0] = true;
119      }
120    }
121
122    /**
123     * Creates a Builder by copying an existing SystemOnStart instance
124     * @param other The existing instance to copy.
125     */
126    private Builder(org.apache.reef.bridge.message.SystemOnStart other) {
127            super(SCHEMA$);
128      if (isValidValue(fields()[0], other.dateTime)) {
129        this.dateTime = data().deepCopy(fields()[0].schema(), other.dateTime);
130        fieldSetFlags()[0] = true;
131      }
132    }
133
134    /**
135      * Gets the value of the 'dateTime' field.
136      * Date time in seconds as a long since January 1, 1970
137      * @return The value.
138      */
139    public java.lang.Long getDateTime() {
140      return dateTime;
141    }
142
143    /**
144      * Sets the value of the 'dateTime' field.
145      * Date time in seconds as a long since January 1, 1970
146      * @param value The value of 'dateTime'.
147      * @return This builder.
148      */
149    public org.apache.reef.bridge.message.SystemOnStart.Builder setDateTime(long value) {
150      validate(fields()[0], value);
151      this.dateTime = value;
152      fieldSetFlags()[0] = true;
153      return this;
154    }
155
156    /**
157      * Checks whether the 'dateTime' field has been set.
158      * Date time in seconds as a long since January 1, 1970
159      * @return True if the 'dateTime' field has been set, false otherwise.
160      */
161    public boolean hasDateTime() {
162      return fieldSetFlags()[0];
163    }
164
165
166    /**
167      * Clears the value of the 'dateTime' field.
168      * Date time in seconds as a long since January 1, 1970
169      * @return This builder.
170      */
171    public org.apache.reef.bridge.message.SystemOnStart.Builder clearDateTime() {
172      fieldSetFlags()[0] = false;
173      return this;
174    }
175
176    @Override
177    public SystemOnStart build() {
178      try {
179        SystemOnStart record = new SystemOnStart();
180        record.dateTime = fieldSetFlags()[0] ? this.dateTime : (java.lang.Long) defaultValue(fields()[0]);
181        return record;
182      } catch (Exception e) {
183        throw new org.apache.avro.AvroRuntimeException(e);
184      }
185    }
186  }
187
188  private static final org.apache.avro.io.DatumWriter
189    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
190
191  @Override public void writeExternal(java.io.ObjectOutput out)
192    throws java.io.IOException {
193    WRITER$.write(this, SpecificData.getEncoder(out));
194  }
195
196  private static final org.apache.avro.io.DatumReader
197    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
198
199  @Override public void readExternal(java.io.ObjectInput in)
200    throws java.io.IOException {
201    READER$.read(this, SpecificData.getDecoder(in));
202  }
203
204}