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