You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Denis Washington (JIRA)" <ji...@apache.org> on 2019/02/07 05:50:00 UTC

[jira] [Created] (AVRO-2320) Generate accessors for field aliases (Java specific compiler)

Denis Washington created AVRO-2320:
--------------------------------------

             Summary: Generate accessors for field aliases (Java specific compiler)
                 Key: AVRO-2320
                 URL: https://issues.apache.org/jira/browse/AVRO-2320
             Project: Apache Avro
          Issue Type: Improvement
            Reporter: Denis Washington


Currently, adding aliases to a field has no effect on the output class generated by SpecificCompiler. To make incremental code evolution easier, it would be beneficial if for each field alias, the compiler would generate corresponding a getter, setter and builder method with the aliased name that points to the same field. So for instance, a field like:
{code:java}
{
  "name": "firstName",
  "type": "string",
  "aliases": ["surname"]
}{code}
would be compiled to the following set of getter methods:
{code:java}
public String getFirstName() {
    return firstName;
}

public String getSurname() {
    return firstName;
}{code}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)