Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2320

Generate accessors for field aliases (Java specific compiler)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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:

      {
        "name": "firstName",
        "type": "string",
        "aliases": ["surname"]
      }

      would be compiled to the following set of getter methods:

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

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              denisw Denis Washington
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: