cutting commented on a change in pull request #842: URL: https://github.com/apache/avro/pull/842#discussion_r414034622
########## File path: lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java ########## @@ -110,14 +112,96 @@ public static ReflectData get() { } /** - * Cause a class to be treated as though it had an {@link Stringable} - ** annotation. + * Cause a class to be treated as though it had an {@link Stringable} * + * annotation. */ public ReflectData addStringable(Class c) { stringableClasses.add(c); return this; } + /** + * If this flag is set to true, default values for fields will be assigned + * dynamically using Java reflections. Let's call this feature `default + * reflection`. Initially this feature is disabled + */ + private boolean defaultGenerated = false; + + /** + * Enable or disable `default reflection` + * + * @param enabled set to `true` to enable the feature. This feature is disabled + * by default + * @return The current instance + */ + public ReflectData setDefaultsGenerated(boolean enabled) { + this.defaultGenerated = enabled; + return this; + } + + private final Map<String, Object> defaultValues = new WeakHashMap<>(); Review comment: Sure, that seems reasonable. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org