Comments (5)
How is that better than simply marking the method @deprecated?
Can you list some specific use-cases where @NotSince will be better than
@deprecated?
Original comment by inder123
on 26 Sep 2008 at 7:39
from google-gson.
Maybe I'm misunderstanding Gson's functionality. Assume the following example:
public class Person {
private int age;
@Since(1.1) private int birthYear;
}
new GsonBuilder().setVersion(1.0).create().toJson(new Person()) => "{age: 0}"
new GsonBuilder().setVersion(1.1).create().toJson(new Person()) => "{age: 0,
birthYear: 0}"
I would like to replace the field, as in (renaming @NotSince to @Until):
public class Person {
@Until(1.1) private int age;
@Since(1.1) private int birthYear;
}
So that:
new GsonBuilder().setVersion(1.0).create().toJson(new Person()) => "{age: 0}"
new GsonBuilder().setVersion(1.1).create().toJson(new Person()) => "{birthYear:
0}"
Original comment by [email protected]
on 27 Sep 2008 at 12:22
from google-gson.
Inderjeet and I have discussed that we needed some way to "version" field
deletions
from classes, but have not put much thought into it. The above proposal seems
like a
pretty good solution.
I prefer "Until" as it fits well with the "Since" annotation.
Original comment by [email protected]
on 27 Sep 2008 at 6:38
from google-gson.
Original comment by [email protected]
on 13 Oct 2008 at 7:13
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from google-gson.
Enhancement submitted in r322.
Original comment by [email protected]
on 1 Dec 2008 at 12:10
- Changed state: Fixed
from google-gson.
Related Issues (20)
- JsonObject toString method doesn't escape double quotes HOT 2
- add set locale method HOT 2
- Can't build gson-1.3 in timezones other than PST: HOT 3
- Why not getter and setter? HOT 4
- JsonParseException is not very informative (does not return the offending string) HOT 1
- Support InputStream HOT 1
- Support handlers for unknown properties, useful for error handling HOT 12
- crash with embeded " HOT 1
- can't handle the following json: {"type":"Point","coordinates":[37.43504333,-122.42824554]} HOT 4
- Fields excluded in ExclusionStrategy should not be made accessible HOT 4
- convert JSON to Map HOT 1
- Circular dependency default exclusion strategy required for persistance frameworks HOT 6
- some other standard ExclusionStrategy needed HOT 5
- json-lib to gson conversion HOT 4
- Support serializing local classes HOT 3
- StackOverflowError for large maps HOT 2
- toJson has many useless character HOT 3
- date format problem HOT 3
- How do I deserialize when the result is sometimes an object and sometimes an array HOT 3
- Cannot deserialize JSON into a JsonObject
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-gson.