/** * Creates a Builder by copying an existing User instance * @param other The existing instance to copy. */ private Builder(example.avro.User other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.favoriteNumber)) { this.favoriteNumber = data().deepCopy(fields()[1].schema(), other.favoriteNumber); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.favoriteColor)) { this.favoriteColor = data().deepCopy(fields()[2].schema(), other.favoriteColor); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.eventType)) { this.eventType = data().deepCopy(fields()[3].schema(), other.eventType); fieldSetFlags()[3] = true; } }
@Override @SuppressWarnings("unchecked") public User build() { try { User record = new User(); record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]); record.favoriteNumber = fieldSetFlags()[1] ? this.favoriteNumber : (java.lang.CharSequence) defaultValue(fields()[1]); record.favoriteColor = fieldSetFlags()[2] ? this.favoriteColor : (java.lang.CharSequence) defaultValue(fields()[2]); record.eventType = fieldSetFlags()[3] ? this.eventType : (example.avro.EventType) defaultValue(fields()[3]); return record; } catch (java.lang.Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(example.avro.User.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.favorite_number)) { this.favorite_number = data().deepCopy(fields()[1].schema(), other.favorite_number); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.favorite_color)) { this.favorite_color = data().deepCopy(fields()[2].schema(), other.favorite_color); fieldSetFlags()[2] = true; } }
/** * Creates a Builder by copying an existing User instance * @param other The existing instance to copy. */ private Builder(example.avro.User other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.favorite_number)) { this.favorite_number = data().deepCopy(fields()[1].schema(), other.favorite_number); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.favorite_color)) { this.favorite_color = data().deepCopy(fields()[2].schema(), other.favorite_color); fieldSetFlags()[2] = true; } }
/** * Creates a Builder by copying an existing User instance * @param other The existing instance to copy. */ private Builder(example.avro.User other) { super(SCHEMA$); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.favorite_number)) { this.favorite_number = data().deepCopy(fields()[1].schema(), other.favorite_number); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.favorite_color)) { this.favorite_color = data().deepCopy(fields()[2].schema(), other.favorite_color); fieldSetFlags()[2] = true; } }
/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(example.avro.User.Builder other) { super(other); if (isValidValue(fields()[0], other.name)) { this.name = data().deepCopy(fields()[0].schema(), other.name); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.favorite_number)) { this.favorite_number = data().deepCopy(fields()[1].schema(), other.favorite_number); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.favorite_color)) { this.favorite_color = data().deepCopy(fields()[2].schema(), other.favorite_color); fieldSetFlags()[2] = true; } }
@Override @SuppressWarnings("unchecked") public User build() { try { User record = new User(); record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]); record.favorite_number = fieldSetFlags()[1] ? this.favorite_number : (java.lang.Integer) defaultValue(fields()[1]); record.favorite_color = fieldSetFlags()[2] ? this.favorite_color : (java.lang.CharSequence) defaultValue(fields()[2]); return record; } catch (java.lang.Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
@Override @SuppressWarnings("unchecked") public User build() { try { User record = new User(); record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]); record.favorite_number = fieldSetFlags()[1] ? this.favorite_number : (java.lang.Integer) defaultValue(fields()[1]); record.favorite_color = fieldSetFlags()[2] ? this.favorite_color : (java.lang.CharSequence) defaultValue(fields()[2]); return record; } catch (java.lang.Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Clears the value of the 'favorite_number' field. * @return This builder. */ public example.avro.User.Builder clearFavoriteNumber() { favorite_number = null; fieldSetFlags()[1] = false; return this; }
/** * Checks whether the 'favorite_number' field has been set. * @return True if the 'favorite_number' field has been set, false otherwise. */ public boolean hasFavoriteNumber() { return fieldSetFlags()[1]; }
/** * Checks whether the 'name' field has been set. * @return True if the 'name' field has been set, false otherwise. */ public boolean hasName() { return fieldSetFlags()[0]; }
/** * Creates a new User RecordBuilder by copying an existing User instance. * @param other The existing instance to copy. * @return A new User RecordBuilder */ public static example.avro.User.Builder newBuilder(example.avro.User other) { return new example.avro.User.Builder(other); }
/** * Clears the value of the 'favorite_color' field. * @return This builder. */ public example.avro.User.Builder clearFavoriteColor() { favorite_color = null; fieldSetFlags()[2] = false; return this; }
/** * Checks whether the 'favorite_color' field has been set. * @return True if the 'favorite_color' field has been set, false otherwise. */ public boolean hasFavoriteColor() { return fieldSetFlags()[2]; }
/** * Clears the value of the 'name' field. * @return This builder. */ public example.avro.User.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; }
/** * Creates a new User RecordBuilder by copying an existing Builder. * @param other The existing builder to copy. * @return A new User RecordBuilder */ public static example.avro.User.Builder newBuilder(example.avro.User.Builder other) { return new example.avro.User.Builder(other); }
/** * Checks whether the 'favorite_color' field has been set. * @return True if the 'favorite_color' field has been set, false otherwise. */ public boolean hasFavoriteColor() { return fieldSetFlags()[2]; }
/** * Clears the value of the 'name' field. * @return This builder. */ public example.avro.User.Builder clearName() { name = null; fieldSetFlags()[0] = false; return this; }
/** * Clears the value of the 'favorite_number' field. * @return This builder. */ public example.avro.User.Builder clearFavoriteNumber() { favorite_number = null; fieldSetFlags()[1] = false; return this; }
/** * Creates a new User RecordBuilder by copying an existing User instance. * @param other The existing instance to copy. * @return A new User RecordBuilder */ public static example.avro.User.Builder newBuilder(example.avro.User other) { return new example.avro.User.Builder(other); }