001/** 002 * Autogenerated by Avro 003 * 004 * DO NOT EDIT DIRECTLY 005 */ 006package org.apache.reef.vortex.common.avro; 007@SuppressWarnings("all") 008@org.apache.avro.specific.AvroGenerated 009public class AvroTaskletCancellationRequest extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { 010 public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroTaskletCancellationRequest\",\"namespace\":\"org.apache.reef.vortex.common.avro\",\"fields\":[{\"name\":\"taskletId\",\"type\":\"int\"}]}"); 011 public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } 012 @Deprecated public int taskletId; 013 014 /** 015 * Default constructor. Note that this does not initialize fields 016 * to their default values from the schema. If that is desired then 017 * one should use <code>newBuilder()</code>. 018 */ 019 public AvroTaskletCancellationRequest() {} 020 021 /** 022 * All-args constructor. 023 */ 024 public AvroTaskletCancellationRequest(java.lang.Integer taskletId) { 025 this.taskletId = taskletId; 026 } 027 028 public org.apache.avro.Schema getSchema() { return SCHEMA$; } 029 // Used by DatumWriter. Applications should not call. 030 public java.lang.Object get(int field$) { 031 switch (field$) { 032 case 0: return taskletId; 033 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 034 } 035 } 036 // Used by DatumReader. Applications should not call. 037 @SuppressWarnings(value="unchecked") 038 public void put(int field$, java.lang.Object value$) { 039 switch (field$) { 040 case 0: taskletId = (java.lang.Integer)value$; break; 041 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 042 } 043 } 044 045 /** 046 * Gets the value of the 'taskletId' field. 047 */ 048 public java.lang.Integer getTaskletId() { 049 return taskletId; 050 } 051 052 /** 053 * Sets the value of the 'taskletId' field. 054 * @param value the value to set. 055 */ 056 public void setTaskletId(java.lang.Integer value) { 057 this.taskletId = value; 058 } 059 060 /** Creates a new AvroTaskletCancellationRequest RecordBuilder */ 061 public static org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder newBuilder() { 062 return new org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder(); 063 } 064 065 /** Creates a new AvroTaskletCancellationRequest RecordBuilder by copying an existing Builder */ 066 public static org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder newBuilder(org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder other) { 067 return new org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder(other); 068 } 069 070 /** Creates a new AvroTaskletCancellationRequest RecordBuilder by copying an existing AvroTaskletCancellationRequest instance */ 071 public static org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder newBuilder(org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest other) { 072 return new org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder(other); 073 } 074 075 /** 076 * RecordBuilder for AvroTaskletCancellationRequest instances. 077 */ 078 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroTaskletCancellationRequest> 079 implements org.apache.avro.data.RecordBuilder<AvroTaskletCancellationRequest> { 080 081 private int taskletId; 082 083 /** Creates a new Builder */ 084 private Builder() { 085 super(org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.SCHEMA$); 086 } 087 088 /** Creates a Builder by copying an existing Builder */ 089 private Builder(org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder other) { 090 super(other); 091 if (isValidValue(fields()[0], other.taskletId)) { 092 this.taskletId = data().deepCopy(fields()[0].schema(), other.taskletId); 093 fieldSetFlags()[0] = true; 094 } 095 } 096 097 /** Creates a Builder by copying an existing AvroTaskletCancellationRequest instance */ 098 private Builder(org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest other) { 099 super(org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.SCHEMA$); 100 if (isValidValue(fields()[0], other.taskletId)) { 101 this.taskletId = data().deepCopy(fields()[0].schema(), other.taskletId); 102 fieldSetFlags()[0] = true; 103 } 104 } 105 106 /** Gets the value of the 'taskletId' field */ 107 public java.lang.Integer getTaskletId() { 108 return taskletId; 109 } 110 111 /** Sets the value of the 'taskletId' field */ 112 public org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder setTaskletId(int value) { 113 validate(fields()[0], value); 114 this.taskletId = value; 115 fieldSetFlags()[0] = true; 116 return this; 117 } 118 119 /** Checks whether the 'taskletId' field has been set */ 120 public boolean hasTaskletId() { 121 return fieldSetFlags()[0]; 122 } 123 124 /** Clears the value of the 'taskletId' field */ 125 public org.apache.reef.vortex.common.avro.AvroTaskletCancellationRequest.Builder clearTaskletId() { 126 fieldSetFlags()[0] = false; 127 return this; 128 } 129 130 @Override 131 public AvroTaskletCancellationRequest build() { 132 try { 133 AvroTaskletCancellationRequest record = new AvroTaskletCancellationRequest(); 134 record.taskletId = fieldSetFlags()[0] ? this.taskletId : (java.lang.Integer) defaultValue(fields()[0]); 135 return record; 136 } catch (Exception e) { 137 throw new org.apache.avro.AvroRuntimeException(e); 138 } 139 } 140 } 141}