diff options
author | Marcono1234 <Marcono1234@users.noreply.github.com> | 2022-12-18 00:30:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 15:30:08 -0800 |
commit | 4aaf1385db5ffbc99de7411e5e80201fd8da7f3c (patch) | |
tree | 61da1ea4e25521f09d308cac8209363a4f21c7b4 | |
parent | a19d53f5358e7a4e12817d766b3289def78a989d (diff) | |
download | gson-4aaf1385db5ffbc99de7411e5e80201fd8da7f3c.tar.gz |
Improve variable names in user guide (#2290)
-rw-r--r-- | UserGuide.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/UserGuide.md b/UserGuide.md index f2988065..03f72415 100644 --- a/UserGuide.md +++ b/UserGuide.md @@ -110,12 +110,12 @@ int[] values = { 1 }; gson.toJson(values); // ==> [1] // Deserialization -int one = gson.fromJson("1", int.class); -Integer one = gson.fromJson("1", Integer.class); -Long one = gson.fromJson("1", Long.class); -Boolean false = gson.fromJson("false", Boolean.class); +int i = gson.fromJson("1", int.class); +Integer intObj = gson.fromJson("1", Integer.class); +Long longObj = gson.fromJson("1", Long.class); +Boolean boolObj = gson.fromJson("false", Boolean.class); String str = gson.fromJson("\"abc\"", String.class); -String[] anotherStr = gson.fromJson("[\"abc\"]", String[].class); +String[] strArray = gson.fromJson("[\"abc\"]", String[].class); ``` ### Object Examples @@ -482,7 +482,7 @@ class MyList<T> extends ArrayList<T> { } class MyListInstanceCreator implements InstanceCreator<MyList<?>> { - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") public MyList<?> createInstance(Type type) { // No need to use a parameterized list since the actual instance will have the raw type anyway. return new MyList(); |