[ 
https://issues.apache.org/jira/browse/AVRO-2419?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2419.
-------------------------------
    Fix Version/s: 1.10.0
       Resolution: Fixed

> Generate private attribute in Java
> ----------------------------------
>
>                 Key: AVRO-2419
>                 URL: https://issues.apache.org/jira/browse/AVRO-2419
>             Project: Apache Avro
>          Issue Type: Wish
>          Components: java
>    Affects Versions: 1.7.7
>            Reporter: khuynhthanhchiluyen
>            Assignee: Zezeng Wang
>            Priority: Major
>             Fix For: 1.10.0
>
>
> I used file user.avsc like below:
> {  
>     "namespace":"example.avro",
>     "type":"record",
>     "name":"User",
>     "fields":[  
>        
> {            "name":"name",          "type":"string"       }
> ,
>        
> {            "name":"favorite_number",          "type":[               "int", 
>             "null"          ]       }
> ,
>        
> {            "name":"favorite_color",          "type":[               
> "string",             "null"          ]       }
>    ]
>  }
>  
> And I used avro-1.7.7.jar to generate my Java code:
> java -jar java -jar avro-tools-1.7.7.jar compile -string schema user.avsc 
> D:\result
>  
> But all attributes of User class (name, favorite_number, favorite_color) 
> appear to be "public". Where did I miss to make them private (for 
> encapsulation). Thank you very much.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to