Coder Social home page Coder Social logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024

Original comment by [email protected] on 13 Oct 2008 at 7:13

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from google-gson.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 17, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.