google / google/gson

Read and write Json properties using methods (ie. getters & setters)

Open
#232 16 comments 20 reactions 0 assignees View on GitHub
auto-migrated enhancement Milestone-Undefined Priority-Medium Type-Enhancement
Dominant language
Java
Stars
24.2k
Forks
4.5k
Avg merge
6d 4h
Merged PRs (30d)
12

Description

```
if your object has an int getId(); method. Maybe you want to have a

@Field("id")
public int getId();

When the Json is generated the getId() method is called and the result is
placed in "id"
I know that I could have a int field in my class, but, in my case the Id is
generate by Hibernate once the object is saved.

```

Original issue reported on code.google.com by `Germanattanasio` on 7 Sep 2010 at 2:04

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.