Skip to content

Commit

Permalink
Merge pull request #17 from sbxcloud/annotationlib
Browse files Browse the repository at this point in the history
beta5
  • Loading branch information
lgguzman authored Mar 31, 2017
2 parents 6143ccb + e609ee0 commit b040d87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Agregamos la librería como dependencia

dependencies {
//...otras dependencias de tu proyeco aquí.....
compile 'com.github.sbxcloud:androidlib:v2.2.0-beta4'
compile 'com.github.sbxcloud:androidlib:v2.2.0-beta5'
}
Esta librería se basa en annotaciones. Para crear tu propia Clase usuario puedes hacerla así:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public static Object getSbxModel(JSONObject jsonObject, Class<?> clazz, int lev
break;
}
case "class java.lang.Float": {
variable.set(o, jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
variable.set(o, (float)jsonObject.getDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
break;
}
case "float": {
variable.set(o, jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
variable.set(o, (float)jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
break;
}
case "class java.util.Date": {
Expand Down Expand Up @@ -215,11 +215,11 @@ public static void getSbxModel(JSONObject jsonObject, Class<?> clazz, Object o,
break;
}
case "class java.lang.Float": {
variable.set(o, jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
variable.set(o, (float)jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
break;
}
case "float": {
variable.set(o, jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
variable.set(o, (float)jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
break;
}
case "class java.util.Date": {
Expand Down Expand Up @@ -358,11 +358,11 @@ public static void getSbxModel(JSONObject jsonObject, Class<?> clazz, Object o,
break;
}
case "class java.lang.Float": {
variable.set(o, jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
variable.set(o, (float)jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
break;
}
case "float": {
variable.set(o, jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
variable.set(o, (float)jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
break;
}
case "class java.util.Date": {
Expand Down Expand Up @@ -515,11 +515,11 @@ public static Object getSbxModel(JSONObject jsonObject, Class<?> clazz, int lev
break;
}
case "class java.lang.Float": {
variable.set(o, jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
variable.set(o, (float)jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
break;
}
case "float": {
variable.set(o, jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
variable.set(o, (float)jsonObject.optDouble(SbxDataValidator.getAnnotationName(variable, annotation)));
break;
}
case "class java.util.Date": {
Expand Down

0 comments on commit b040d87

Please sign in to comment.