aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/api/Utils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/juick/api/Utils.java')
-rw-r--r--src/java/com/juick/api/Utils.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/java/com/juick/api/Utils.java b/src/java/com/juick/api/Utils.java
index b406c362..10e0cccb 100644
--- a/src/java/com/juick/api/Utils.java
+++ b/src/java/com/juick/api/Utils.java
@@ -135,4 +135,15 @@ public class Utils {
ret = ret.replaceAll("@", "\\\\@");
return ret;
}
+
+ public static int parseInt(String str, int def) {
+ int ret = def;
+ if (str != null) {
+ try {
+ ret = Integer.parseInt(str);
+ } catch (Exception e) {
+ }
+ }
+ return ret;
+ }
}