json-iterator / java

jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go
http://jsoniter.com/
MIT License
1.51k stars 518 forks source link

Exists method for check if Any object is empty #230

Open mmaryo opened 5 years ago

mmaryo commented 5 years ago

Add method to check if a field exists

Before :

            Any rowField = atFields.get(mappingField.getAirtableFieldName());
            boolean exists = true;
            try {rowField.mustBeValid();}catch(Exception e){exists = false;}
            if (exists) {

            }

Now :

            Any rowField = atFields.get(mappingField.getAirtableFieldName());
            if (rowField.exists()) {

            }
codecov-io commented 5 years ago

Codecov Report

Merging #230 into master will decrease coverage by <.01%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
- Coverage   68.46%   68.45%   -0.01%     
==========================================
  Files         107      107              
  Lines        7335     7336       +1     
  Branches     1388     1389       +1     
==========================================
  Hits         5022     5022              
- Misses       1867     1868       +1     
  Partials      446      446
Impacted Files Coverage Δ
src/main/java/com/jsoniter/any/Any.java 59.13% <0%> (-0.52%) :arrow_down:

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 e48a7a1...9b9e94c. Read the comment docs.