Skip to content

Commit

Permalink
1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzue committed Nov 3, 2022
1 parent 49ef0c9 commit 6c54aaa
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 9 deletions.
Binary file modified .gradle/6.7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/6.7.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified .gradle/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/checksums/sha1-checksums.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions basejson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 30
versionCode 8
versionName "1.0.8"
versionCode 9
versionName "1.0.9"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,12 @@ private boolean isNull(String s) {
public boolean equals(Object o) {
return toString().equals(o.toString());
}

@Override
public Object get(int index) {
if (index < 0 || index >= size()) {
return null;
}
return super.get(index);
}
}
12 changes: 6 additions & 6 deletions basejson/src/main/java/com/kongzue/baseokhttp/util/JsonMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public int getInt(String key, int emptyValue) {
result = Integer.parseInt(get(key) + "");
} catch (Exception e) {
}
return result;
return result == 0 ? emptyValue : result;
}

public boolean getBoolean(String key) {
Expand All @@ -180,7 +180,7 @@ public boolean getBoolean(String key, boolean emptyValue) {
result = Boolean.parseBoolean(get(key) + "");
} catch (Exception e) {
}
return result;
return result == false ? emptyValue : result;
}

public long getLong(String key) {
Expand All @@ -193,7 +193,7 @@ public long getLong(String key, long emptyValue) {
result = Long.parseLong(get(key) + "");
} catch (Exception e) {
}
return result;
return result == 0 ? emptyValue : result;
}

public short getShort(String key) {
Expand All @@ -206,7 +206,7 @@ public short getShort(String key, short emptyValue) {
result = Short.parseShort(get(key) + "");
} catch (Exception e) {
}
return result;
return result == 0?emptyValue:result;
}

public double getDouble(String key) {
Expand All @@ -219,7 +219,7 @@ public double getDouble(String key, double emptyValue) {
result = Double.parseDouble(get(key) + "");
} catch (Exception e) {
}
return result;
return result==0?emptyValue:result;
}

public float getFloat(String key) {
Expand All @@ -232,7 +232,7 @@ public float getFloat(String key, float emptyValue) {
result = Float.parseFloat(get(key) + "");
} catch (Exception e) {
}
return result;
return result==0?emptyValue:result;
}

public JsonList getList(String key) {
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit 6c54aaa

Please sign in to comment.