Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override the get method on JSONObject #54

Merged
merged 1 commit into from
Apr 23, 2022
Merged

Override the get method on JSONObject #54

merged 1 commit into from
Apr 23, 2022

Conversation

kraity
Copy link
Collaborator

@kraity kraity commented Apr 23, 2022

覆盖 JSONObject 上的 get 方法以确保原始数据键也能够映射

JSONObject jsonObject = JSONObject.of("123", "value1", "456.789", "value2", null, "value3");
assertEquals("value1", jsonObject.get(123));
assertEquals("value2", jsonObject.get(456.789));
assertEquals("value3", jsonObject.get(null));
assertEquals("value4", jsonObject.getOrDefault(false, "value4"));

@codecov-commenter
Copy link

codecov-commenter commented Apr 23, 2022

Codecov Report

Merging #54 (c292625) into main (857b474) will increase coverage by 0.00%.
The diff coverage is 87.50%.

@@            Coverage Diff            @@
##               main      #54   +/-   ##
=========================================
  Coverage     64.76%   64.76%           
- Complexity     7991     7996    +5     
=========================================
  Files           414      414           
  Lines         45274    45284   +10     
  Branches       9144     9144           
=========================================
+ Hits          29321    29330    +9     
+ Misses        12402    12401    -1     
- Partials       3551     3553    +2     
Impacted Files Coverage Δ
...src/main/java/com/alibaba/fastjson2/JSONArray.java 93.43% <ø> (ø)
...rc/main/java/com/alibaba/fastjson2/JSONObject.java 85.01% <87.50%> (+0.66%) ⬆️
...ain/java/com/alibaba/fastjson2/JSONWriterUTF8.java 74.71% <0.00%> (-0.13%) ⬇️
...in/java/com/alibaba/fastjson2/JSONWriterJSONB.java 57.43% <0.00%> (-0.10%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 857b474...c292625. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants