package org.ccci.gto.android.common.util;

import android.support.annotation.Nullable;

public class NumberUtils {
    @Nullable
    public static Integer toInteger(@Nullable final String raw, @Nullable final Integer defaultValue) {
        if (raw != null) {
            try {
                return Integer.valueOf(raw);
            } catch (final NumberFormatException ignored) {
            }
        }

        return defaultValue;
    }

    @Nullable
    public static Long toLong(@Nullable final String raw, @Nullable final Long defaultValue) {
        if (raw != null) {
            try {
                return Long.valueOf(raw);
            } catch (final NumberFormatException ignored) {
            }
        }

        return defaultValue;
    }

    @Nullable
    public static Double toDouble(@Nullable final String raw, @Nullable final Double defaultValue) {
        if (raw != null) {
            try {
                return Double.valueOf(raw);
            } catch (final NumberFormatException ignored) {
            }
        }

        return defaultValue;
    }

    @Nullable
    public static Float toFloat(@Nullable final String raw, @Nullable final Float defaultValue) {
        if (raw != null) {
            try {
                return Float.valueOf(raw);
            } catch (final NumberFormatException ignored) {
            }
        }

        return defaultValue;
    }
}

@@ -81,16 +81,60 @@
 lable;%0A%0A
+import org.jetbrains.annotations.Contract;%0A%0A
 public c
@@ -158,32 +158,67 @@
 %7B%0A    @Nullable%0A
+    @Contract(%22_, !null -%3E !null%22)%0A
     public stati
@@ -522,32 +522,67 @@
 %0A%0A    @Nullable%0A
+    @Contract(%22_, !null -%3E !null%22)%0A
     public stati
@@ -874,32 +874,67 @@
 %0A%0A    @Nullable%0A
+    @Contract(%22_, !null -%3E !null%22)%0A
     public stati
@@ -1220,32 +1220,32 @@
 ltValue;%0A    %7D%0A%0A
-
     @Nullable%0A  
@@ -1238,24 +1238,59 @@
   @Nullable%0A
+    @Contract(%22_, !null -%3E !null%22)%0A
     public s

annotate the NumberUtils methods with Contract annotations to provide accurate static code analysis