You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by to...@apache.org on 2015/06/26 16:39:15 UTC
svn commit: r1687778 - in /avro/trunk: ./
lang/java/avro/src/main/java/org/apache/avro/
lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/
lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/ lang/j...
Author: tomwhite
Date: Fri Jun 26 14:39:14 2015
New Revision: 1687778
URL: http://svn.apache.org/r1687778
Log:
AVRO-1681. Improve generated JavaDocs. Contributed by Charles Gariépy-Ikeson.
Modified:
avro/trunk/CHANGES.txt
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java
avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm
avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/protocol.vm
avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java
avro/trunk/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java
avro/trunk/lang/java/tools/src/test/compiler/output/Player.java
Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1687778&r1=1687777&r2=1687778&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Fri Jun 26 14:39:14 2015
@@ -79,6 +79,9 @@ Trunk (not yet released)
AVRO-1655. Java: Add Schema.createRecord with field list.
(Lars Francke via blue)
+ AVRO-1681. Improve generated JavaDocs.
+ (Charles Gariépy-Ikeson via tomwhite)
+
BUG FIXES
AVRO-1553. Java: MapReduce never uses MapOutputValueSchema (tomwhite)
Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java?rev=1687778&r1=1687777&r2=1687778&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/Protocol.java Fri Jun 26 14:39:14 2015
@@ -478,8 +478,12 @@ public class Protocol extends JsonProper
if (fieldTypeNode == null)
throw new SchemaParseException("No param type: "+field);
String name = fieldNameNode.getTextValue();
+ String fieldDoc = null;
+ JsonNode fieldDocNode = field.get("doc");
+ if (fieldDocNode != null)
+ fieldDoc = fieldDocNode.getTextValue();
fields.add(new Field(name, Schema.parse(fieldTypeNode,types),
- null /* message fields don't have docs */,
+ fieldDoc,
field.get("default")));
}
Schema request = Schema.createRecord(fields);
Modified: avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm?rev=1687778&r1=1687777&r2=1687778&view=diff
==============================================================================
--- avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm (original)
+++ avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/fixed.vm Fri Jun 26 14:39:14 2015
@@ -38,7 +38,10 @@ public class ${this.mangle($schema.getNa
super();
}
- /** Creates a new ${this.mangle($schema.getName())} with the given bytes */
+ /**
+ * Creates a new ${this.mangle($schema.getName())} with the given bytes.
+ * @param bytes The bytes to create the new ${this.mangle($schema.getName())}.
+ */
public ${this.mangle($schema.getName())}(byte[] bytes) {
super(bytes);
}
Modified: avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/protocol.vm
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/protocol.vm?rev=1687778&r1=1687777&r2=1687778&view=diff
==============================================================================
--- avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/protocol.vm (original)
+++ avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/protocol.vm Fri Jun 26 14:39:14 2015
@@ -33,9 +33,15 @@ public interface $this.mangle($protocol.
#set ($name = $e.getKey())
#set ($message = $e.getValue())
#set ($response = $message.getResponse())
+ /**
#if ($message.getDoc())
- /** $this.escapeForJavadoc($message.getDoc()) */
+ * $this.escapeForJavadoc($message.getDoc())
#end
+#foreach ($p in $message.getRequest().getFields())##
+#if ($p.doc()) * @param ${this.mangle($p.name())} $p.doc()
+#end
+#end
+ */
#foreach ($annotation in $this.javaAnnotations($message))
@$annotation
#end
@@ -67,9 +73,16 @@ public interface $this.mangle($protocol.
#set ($response = $message.getResponse())
## Generate callback method if the message is not one-way:
#if (! $message.isOneWay())
+ /**
#if ($message.getDoc())
- /** $this.escapeForJavadoc($message.getDoc()) */
+ * $this.escapeForJavadoc($message.getDoc())
+#end
+#foreach ($p in $message.getRequest().getFields())##
+#if ($p.doc()) * @param ${this.mangle($p.name())} $p.doc()
+#end
#end
+ * @throws java.io.IOException The async call could not be completed.
+ */
void ${this.mangle($name)}(##
#foreach ($p in $message.getRequest().getFields())##
#* *#${this.javaUnbox($p.schema())} ${this.mangle($p.name())}#if ($velocityHasNext), #end
Modified: avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm?rev=1687778&r1=1687777&r2=1687778&view=diff
==============================================================================
--- avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm (original)
+++ avro/trunk/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm Fri Jun 26 14:39:14 2015
@@ -69,6 +69,10 @@ public class ${this.mangle($schema.getNa
/**
* All-args constructor.
+#foreach ($field in $schema.getFields())
+#if ($field.doc()) * @param ${this.mangle($field.name())} $field.doc()
+#end
+#end
*/
public ${this.mangle($schema.getName())}(#foreach($field in $schema.getFields())${this.javaType($field.schema())} ${this.mangle($field.name())}#if($velocityCount < $schema.getFields().size()), #end#end) {
#foreach ($field in $schema.getFields())
@@ -106,7 +110,7 @@ public class ${this.mangle($schema.getNa
#foreach ($field in $schema.getFields())
/**
* Gets the value of the '${this.mangle($field.name(), $schema.isError())}' field.
-#if ($field.doc()) * $field.doc()
+#if ($field.doc()) * @return $field.doc()
#end
*/
public ${this.javaType($field.schema())} ${this.generateGetMethod($schema, $field)}() {
@@ -126,17 +130,28 @@ public class ${this.mangle($schema.getNa
#end
#end
- /** Creates a new ${this.mangle($schema.getName())} RecordBuilder */
+ /**
+ * Creates a new ${this.mangle($schema.getName())} RecordBuilder.
+ * @return A new ${this.mangle($schema.getName())} RecordBuilder
+ */
public static #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder newBuilder() {
return new #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder();
}
- /** Creates a new ${this.mangle($schema.getName())} RecordBuilder by copying an existing Builder */
+ /**
+ * Creates a new ${this.mangle($schema.getName())} RecordBuilder by copying an existing Builder.
+ * @param other The existing builder to copy.
+ * @return A new ${this.mangle($schema.getName())} RecordBuilder
+ */
public static #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder newBuilder(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder other) {
return new #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder(other);
}
- /** Creates a new ${this.mangle($schema.getName())} RecordBuilder by copying an existing $this.mangle($schema.getName()) instance */
+ /**
+ * Creates a new ${this.mangle($schema.getName())} RecordBuilder by copying an existing $this.mangle($schema.getName()) instance.
+ * @param other The existing instance to copy.
+ * @return A new ${this.mangle($schema.getName())} RecordBuilder
+ */
public static #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder newBuilder(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())} other) {
return new #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder(other);
}
@@ -149,6 +164,9 @@ public class ${this.mangle($schema.getNa
implements#if ($schema.isError()) org.apache.avro.data.ErrorBuilder<${this.mangle($schema.getName())}>#else org.apache.avro.data.RecordBuilder<${this.mangle($schema.getName())}>#end {
#foreach ($field in $schema.getFields())
+#if ($field.doc())
+ /** $field.doc() */
+#end
private ${this.javaUnbox($field.schema())} ${this.mangle($field.name(), $schema.isError())};
#if (${this.hasBuilder($field.schema())})
private ${this.javaUnbox($field.schema())}.Builder ${this.mangle($field.name(), $schema.isError())}Builder;
@@ -160,7 +178,10 @@ public class ${this.mangle($schema.getNa
super(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.SCHEMA$);
}
- /** Creates a Builder by copying an existing Builder */
+ /**
+ * Creates a Builder by copying an existing Builder.
+ * @param other The existing Builder to copy.
+ */
private Builder(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder other) {
super(other);
#foreach ($field in $schema.getFields())
@@ -176,7 +197,10 @@ public class ${this.mangle($schema.getNa
#end
}
- /** Creates a Builder by copying an existing $this.mangle($schema.getName()) instance */
+ /**
+ * Creates a Builder by copying an existing $this.mangle($schema.getName()) instance
+ * @param other The existing instance to copy.
+ */
private Builder(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())} other) {
#if ($schema.isError())super(other)#else
super(#if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.SCHEMA$)#end;
@@ -222,6 +246,7 @@ public class ${this.mangle($schema.getNa
* Gets the value of the '${this.mangle($field.name(), $schema.isError())}' field.
#if ($field.doc()) * $field.doc()
#end
+ * @return The value.
*/
public ${this.javaType($field.schema())} ${this.generateGetMethod($schema, $field)}() {
return ${this.mangle($field.name(), $schema.isError())};
@@ -231,7 +256,8 @@ public class ${this.mangle($schema.getNa
* Sets the value of the '${this.mangle($field.name(), $schema.isError())}' field.
#if ($field.doc()) * $field.doc()
#end
- * @param value the value to set.
+ * @param value The value of '${this.mangle($field.name(), $schema.isError())}'.
+ * @return This builder.
*/
public #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder ${this.generateSetMethod($schema, $field)}(${this.javaUnbox($field.schema())} value) {
validate(fields()[$field.pos()], value);
@@ -247,6 +273,7 @@ public class ${this.mangle($schema.getNa
* Checks whether the '${this.mangle($field.name(), $schema.isError())}' field has been set.
#if ($field.doc()) * $field.doc()
#end
+ * @return True if the '${this.mangle($field.name(), $schema.isError())}' field has been set, false otherwise.
*/
public boolean ${this.generateHasMethod($schema, $field)}() {
return fieldSetFlags()[$field.pos()];
@@ -257,6 +284,7 @@ public class ${this.mangle($schema.getNa
* Gets the Builder instance for the '${this.mangle($field.name(), $schema.isError())}' field and creates one if it doesn't exist yet.
#if ($field.doc()) * $field.doc()
#end
+ * @return This builder.
*/
public ${this.javaType($field.schema())}.Builder ${this.generateGetBuilderMethod($schema, $field)}() {
if (${this.mangle($field.name(), $schema.isError())}Builder == null) {
@@ -273,6 +301,7 @@ public class ${this.mangle($schema.getNa
* Sets the Builder instance for the '${this.mangle($field.name(), $schema.isError())}' field
#if ($field.doc()) * $field.doc()
#end
+ * @return This builder.
*/
public #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder ${this.generateSetBuilderMethod($schema, $field)}(${this.javaUnbox($field.schema())}.Builder value) {
${this.generateClearMethod($schema, $field)}();
@@ -284,6 +313,7 @@ public class ${this.mangle($schema.getNa
* Checks whether the '${this.mangle($field.name(), $schema.isError())}' field has an active Builder instance
#if ($field.doc()) * $field.doc()
#end
+ * @return True if the '${this.mangle($field.name(), $schema.isError())}' field has an active Builder instance
*/
public boolean ${this.generateHasBuilderMethod($schema, $field)}() {
return ${this.mangle($field.name(), $schema.isError())}Builder != null;
@@ -294,6 +324,7 @@ public class ${this.mangle($schema.getNa
* Clears the value of the '${this.mangle($field.name(), $schema.isError())}' field.
#if ($field.doc()) * $field.doc()
#end
+ * @return This builder.
*/
public #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder ${this.generateClearMethod($schema, $field)}() {
#if (${this.isUnboxedJavaTypeNullable($field.schema())})
Modified: avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java?rev=1687778&r1=1687777&r2=1687778&view=diff
==============================================================================
--- avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java (original)
+++ avro/trunk/lang/java/ipc/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java Fri Jun 26 14:39:14 2015
@@ -217,7 +217,7 @@ public class TestSpecificCompiler {
if (o.path.endsWith("Simple.java")) {
count++;
assertTrue(o.contents.contains("/** Protocol used for testing. */"));
- assertTrue(o.contents.contains("/** Send a greeting */"));
+ assertTrue(o.contents.contains("* Send a greeting"));
}
}
assertEquals("Missed generated protocol!", 1, count);
Modified: avro/trunk/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java?rev=1687778&r1=1687777&r2=1687778&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java (original)
+++ avro/trunk/lang/java/tools/src/test/compiler/output-string/avro/examples/baseball/Player.java Fri Jun 26 14:39:14 2015
@@ -26,6 +26,7 @@ public class Player extends org.apache.a
/**
* All-args constructor.
+ * @param number The number of the player
*/
public Player(java.lang.Integer number, java.lang.String first_name, java.lang.String last_name, java.util.List<avro.examples.baseball.Position> position) {
this.number = number;
@@ -59,7 +60,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'number' field.
- * The number of the player
+ * @return The number of the player
*/
public java.lang.Integer getNumber() {
return number;
@@ -119,17 +120,28 @@ public class Player extends org.apache.a
this.position = value;
}
- /** Creates a new Player RecordBuilder */
+ /**
+ * Creates a new Player RecordBuilder.
+ * @return A new Player RecordBuilder
+ */
public static avro.examples.baseball.Player.Builder newBuilder() {
return new avro.examples.baseball.Player.Builder();
}
- /** Creates a new Player RecordBuilder by copying an existing Builder */
+ /**
+ * Creates a new Player RecordBuilder by copying an existing Builder.
+ * @param other The existing builder to copy.
+ * @return A new Player RecordBuilder
+ */
public static avro.examples.baseball.Player.Builder newBuilder(avro.examples.baseball.Player.Builder other) {
return new avro.examples.baseball.Player.Builder(other);
}
- /** Creates a new Player RecordBuilder by copying an existing Player instance */
+ /**
+ * Creates a new Player RecordBuilder by copying an existing Player instance.
+ * @param other The existing instance to copy.
+ * @return A new Player RecordBuilder
+ */
public static avro.examples.baseball.Player.Builder newBuilder(avro.examples.baseball.Player other) {
return new avro.examples.baseball.Player.Builder(other);
}
@@ -140,6 +152,7 @@ public class Player extends org.apache.a
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Player>
implements org.apache.avro.data.RecordBuilder<Player> {
+ /** The number of the player */
private int number;
private java.lang.String first_name;
private java.lang.String last_name;
@@ -150,7 +163,10 @@ public class Player extends org.apache.a
super(avro.examples.baseball.Player.SCHEMA$);
}
- /** Creates a Builder by copying an existing Builder */
+ /**
+ * Creates a Builder by copying an existing Builder.
+ * @param other The existing Builder to copy.
+ */
private Builder(avro.examples.baseball.Player.Builder other) {
super(other);
if (isValidValue(fields()[0], other.number)) {
@@ -171,7 +187,10 @@ public class Player extends org.apache.a
}
}
- /** Creates a Builder by copying an existing Player instance */
+ /**
+ * Creates a Builder by copying an existing Player instance
+ * @param other The existing instance to copy.
+ */
private Builder(avro.examples.baseball.Player other) {
super(avro.examples.baseball.Player.SCHEMA$);
if (isValidValue(fields()[0], other.number)) {
@@ -195,6 +214,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'number' field.
* The number of the player
+ * @return The value.
*/
public java.lang.Integer getNumber() {
return number;
@@ -203,7 +223,8 @@ public class Player extends org.apache.a
/**
* Sets the value of the 'number' field.
* The number of the player
- * @param value the value to set.
+ * @param value The value of 'number'.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder setNumber(int value) {
validate(fields()[0], value);
@@ -215,6 +236,7 @@ public class Player extends org.apache.a
/**
* Checks whether the 'number' field has been set.
* The number of the player
+ * @return True if the 'number' field has been set, false otherwise.
*/
public boolean hasNumber() {
return fieldSetFlags()[0];
@@ -224,6 +246,7 @@ public class Player extends org.apache.a
/**
* Clears the value of the 'number' field.
* The number of the player
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder clearNumber() {
fieldSetFlags()[0] = false;
@@ -232,6 +255,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'first_name' field.
+ * @return The value.
*/
public java.lang.String getFirstName() {
return first_name;
@@ -239,7 +263,8 @@ public class Player extends org.apache.a
/**
* Sets the value of the 'first_name' field.
- * @param value the value to set.
+ * @param value The value of 'first_name'.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder setFirstName(java.lang.String value) {
validate(fields()[1], value);
@@ -250,6 +275,7 @@ public class Player extends org.apache.a
/**
* Checks whether the 'first_name' field has been set.
+ * @return True if the 'first_name' field has been set, false otherwise.
*/
public boolean hasFirstName() {
return fieldSetFlags()[1];
@@ -258,6 +284,7 @@ public class Player extends org.apache.a
/**
* Clears the value of the 'first_name' field.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder clearFirstName() {
first_name = null;
@@ -267,6 +294,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'last_name' field.
+ * @return The value.
*/
public java.lang.String getLastName() {
return last_name;
@@ -274,7 +302,8 @@ public class Player extends org.apache.a
/**
* Sets the value of the 'last_name' field.
- * @param value the value to set.
+ * @param value The value of 'last_name'.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder setLastName(java.lang.String value) {
validate(fields()[2], value);
@@ -285,6 +314,7 @@ public class Player extends org.apache.a
/**
* Checks whether the 'last_name' field has been set.
+ * @return True if the 'last_name' field has been set, false otherwise.
*/
public boolean hasLastName() {
return fieldSetFlags()[2];
@@ -293,6 +323,7 @@ public class Player extends org.apache.a
/**
* Clears the value of the 'last_name' field.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder clearLastName() {
last_name = null;
@@ -302,6 +333,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'position' field.
+ * @return The value.
*/
public java.util.List<avro.examples.baseball.Position> getPosition() {
return position;
@@ -309,7 +341,8 @@ public class Player extends org.apache.a
/**
* Sets the value of the 'position' field.
- * @param value the value to set.
+ * @param value The value of 'position'.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder setPosition(java.util.List<avro.examples.baseball.Position> value) {
validate(fields()[3], value);
@@ -320,6 +353,7 @@ public class Player extends org.apache.a
/**
* Checks whether the 'position' field has been set.
+ * @return True if the 'position' field has been set, false otherwise.
*/
public boolean hasPosition() {
return fieldSetFlags()[3];
@@ -328,6 +362,7 @@ public class Player extends org.apache.a
/**
* Clears the value of the 'position' field.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder clearPosition() {
position = null;
Modified: avro/trunk/lang/java/tools/src/test/compiler/output/Player.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/test/compiler/output/Player.java?rev=1687778&r1=1687777&r2=1687778&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/test/compiler/output/Player.java (original)
+++ avro/trunk/lang/java/tools/src/test/compiler/output/Player.java Fri Jun 26 14:39:14 2015
@@ -26,6 +26,7 @@ public class Player extends org.apache.a
/**
* All-args constructor.
+ * @param number The number of the player
*/
public Player(java.lang.Integer number, java.lang.CharSequence first_name, java.lang.CharSequence last_name, java.util.List<avro.examples.baseball.Position> position) {
this.number = number;
@@ -59,7 +60,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'number' field.
- * The number of the player
+ * @return The number of the player
*/
public java.lang.Integer getNumber() {
return number;
@@ -119,17 +120,28 @@ public class Player extends org.apache.a
this.position = value;
}
- /** Creates a new Player RecordBuilder */
+ /**
+ * Creates a new Player RecordBuilder.
+ * @return A new Player RecordBuilder
+ */
public static avro.examples.baseball.Player.Builder newBuilder() {
return new avro.examples.baseball.Player.Builder();
}
- /** Creates a new Player RecordBuilder by copying an existing Builder */
+ /**
+ * Creates a new Player RecordBuilder by copying an existing Builder.
+ * @param other The existing builder to copy.
+ * @return A new Player RecordBuilder
+ */
public static avro.examples.baseball.Player.Builder newBuilder(avro.examples.baseball.Player.Builder other) {
return new avro.examples.baseball.Player.Builder(other);
}
- /** Creates a new Player RecordBuilder by copying an existing Player instance */
+ /**
+ * Creates a new Player RecordBuilder by copying an existing Player instance.
+ * @param other The existing instance to copy.
+ * @return A new Player RecordBuilder
+ */
public static avro.examples.baseball.Player.Builder newBuilder(avro.examples.baseball.Player other) {
return new avro.examples.baseball.Player.Builder(other);
}
@@ -140,6 +152,7 @@ public class Player extends org.apache.a
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<Player>
implements org.apache.avro.data.RecordBuilder<Player> {
+ /** The number of the player */
private int number;
private java.lang.CharSequence first_name;
private java.lang.CharSequence last_name;
@@ -150,7 +163,10 @@ public class Player extends org.apache.a
super(avro.examples.baseball.Player.SCHEMA$);
}
- /** Creates a Builder by copying an existing Builder */
+ /**
+ * Creates a Builder by copying an existing Builder.
+ * @param other The existing Builder to copy.
+ */
private Builder(avro.examples.baseball.Player.Builder other) {
super(other);
if (isValidValue(fields()[0], other.number)) {
@@ -171,7 +187,10 @@ public class Player extends org.apache.a
}
}
- /** Creates a Builder by copying an existing Player instance */
+ /**
+ * Creates a Builder by copying an existing Player instance
+ * @param other The existing instance to copy.
+ */
private Builder(avro.examples.baseball.Player other) {
super(avro.examples.baseball.Player.SCHEMA$);
if (isValidValue(fields()[0], other.number)) {
@@ -195,6 +214,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'number' field.
* The number of the player
+ * @return The value.
*/
public java.lang.Integer getNumber() {
return number;
@@ -203,7 +223,8 @@ public class Player extends org.apache.a
/**
* Sets the value of the 'number' field.
* The number of the player
- * @param value the value to set.
+ * @param value The value of 'number'.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder setNumber(int value) {
validate(fields()[0], value);
@@ -215,6 +236,7 @@ public class Player extends org.apache.a
/**
* Checks whether the 'number' field has been set.
* The number of the player
+ * @return True if the 'number' field has been set, false otherwise.
*/
public boolean hasNumber() {
return fieldSetFlags()[0];
@@ -224,6 +246,7 @@ public class Player extends org.apache.a
/**
* Clears the value of the 'number' field.
* The number of the player
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder clearNumber() {
fieldSetFlags()[0] = false;
@@ -232,6 +255,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'first_name' field.
+ * @return The value.
*/
public java.lang.CharSequence getFirstName() {
return first_name;
@@ -239,7 +263,8 @@ public class Player extends org.apache.a
/**
* Sets the value of the 'first_name' field.
- * @param value the value to set.
+ * @param value The value of 'first_name'.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder setFirstName(java.lang.CharSequence value) {
validate(fields()[1], value);
@@ -250,6 +275,7 @@ public class Player extends org.apache.a
/**
* Checks whether the 'first_name' field has been set.
+ * @return True if the 'first_name' field has been set, false otherwise.
*/
public boolean hasFirstName() {
return fieldSetFlags()[1];
@@ -258,6 +284,7 @@ public class Player extends org.apache.a
/**
* Clears the value of the 'first_name' field.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder clearFirstName() {
first_name = null;
@@ -267,6 +294,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'last_name' field.
+ * @return The value.
*/
public java.lang.CharSequence getLastName() {
return last_name;
@@ -274,7 +302,8 @@ public class Player extends org.apache.a
/**
* Sets the value of the 'last_name' field.
- * @param value the value to set.
+ * @param value The value of 'last_name'.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder setLastName(java.lang.CharSequence value) {
validate(fields()[2], value);
@@ -285,6 +314,7 @@ public class Player extends org.apache.a
/**
* Checks whether the 'last_name' field has been set.
+ * @return True if the 'last_name' field has been set, false otherwise.
*/
public boolean hasLastName() {
return fieldSetFlags()[2];
@@ -293,6 +323,7 @@ public class Player extends org.apache.a
/**
* Clears the value of the 'last_name' field.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder clearLastName() {
last_name = null;
@@ -302,6 +333,7 @@ public class Player extends org.apache.a
/**
* Gets the value of the 'position' field.
+ * @return The value.
*/
public java.util.List<avro.examples.baseball.Position> getPosition() {
return position;
@@ -309,7 +341,8 @@ public class Player extends org.apache.a
/**
* Sets the value of the 'position' field.
- * @param value the value to set.
+ * @param value The value of 'position'.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder setPosition(java.util.List<avro.examples.baseball.Position> value) {
validate(fields()[3], value);
@@ -320,6 +353,7 @@ public class Player extends org.apache.a
/**
* Checks whether the 'position' field has been set.
+ * @return True if the 'position' field has been set, false otherwise.
*/
public boolean hasPosition() {
return fieldSetFlags()[3];
@@ -328,6 +362,7 @@ public class Player extends org.apache.a
/**
* Clears the value of the 'position' field.
+ * @return This builder.
*/
public avro.examples.baseball.Player.Builder clearPosition() {
position = null;