如何在Java中配置Gson以启用版本支持?

如何在Java中配置Gson以启用版本支持?

We can create a Gson instance with versioning using the GsonBuilder().setVersion() method. If we mentioned like setVersion(2.0), means that all the fields having 2.0 or less are eligible to parse.

Syntax

public GsonBuilder setVersion(double ignoreVersionsAfter)登录后复制