Sorry if I forgot to mention, I am working with Builder way of creating a Record. Thus taking example of clearing all fields on User example.
User.Builder userBuilder = User.newBuilder(); // Step-1: Logic: set fields on userBuilder, potentially emit User object by building it userBuilder.build() // Step-2: Clear the contents on userBuilder, by calling userBuilder.clearAll() (new feature) // Step-3: Go back to Step-1 *Avro Getting Started:* http://avro.apache.org/docs/1.7.7/gettingstartedjava.html#Creating+Users Thanks, - Maulik On Tue, Jan 6, 2015 at 3:33 PM, Maulik Gandhi <mmg...@gmail.com> wrote: > Hello Avro Users, > > Questions: > > 1. I was wondering if adding a functionality of clearing all fields on > Record, makes sense or not? > 2. I was wondering if adding a functionality of reseting all fields to > default value (the default value would be what has been defined in AVDL) on > Record, makes sense or not? > > I did look up through old mail archive list and JIRA queue, but could not > find anything similar, please point me to any documentation or links if I > missed them. > > In order to achieve what I am asking here, my best guess is modifying > existing Record template. Please correct me if I am going on wrong path. > > *Record.vm*: > https://github.com/apache/avro/blob/branch-1.7/lang/java/compiler/src/main/velocity/org/apache/avro/compiler/specific/templates/java/classic/record.vm > > Thanks for your help and awesome work!! > > Thanks, > - Maulik >