package com.kickstarter.libs.utils;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import rx.functions.Func1;

public class ObjectUtils {
  private ObjectUtils(){}

  public static boolean isNull(@Nullable final Object object) {
    return object == null;
  }

  public static boolean isNotNull(@Nullable final Object object) {
    return object != null;
  }

  /**
   * Returns the first non-`null` value of its arguments.
   */
  @NonNull public static <T> T coalesce(@Nullable final T value, @NonNull final T theDefault) {
    if (value != null) {
      return value;
    }
    return theDefault;
  }

  /**
   * Returns a function `T -> T` that coalesces values with `theDefault`.
   */
  @NonNull public static <T> Func1<T, T> coalesceWith(@NonNull final T theDefault) {
    return (value) -> ObjectUtils.coalesce(value, theDefault);
  }
}

@@ -877,11 +877,1016 @@
 lt);%0A  %7D
+%0A%0A  /**%0A   * Converts an %7B@link Integer%7D to a %7B@link String%7D, or null of the integer is also null.%0A   */%0A  public static @Nullable String toString(@Nullable final Integer n) %7B%0A    if (n != null) %7B%0A      return Integer.toString(n);%0A    %7D%0A%0A    return null;%0A  %7D%0A%0A  /**%0A   * Converts a %7B@link Long%7D to a %7B@link String%7D, or null of the long is also null.%0A   */%0A  public static @Nullable String toString(@Nullable final Long n) %7B%0A    if (n != null) %7B%0A      return Long.toString(n);%0A    %7D%0A%0A    return null;%0A  %7D%0A%0A  /**%0A   * Converts a %7B@link Float%7D to a %7B@link String%7D, or null of the float is also null.%0A   */%0A  public static @Nullable String toString(@Nullable final Float n) %7B%0A    if (n != null) %7B%0A      return Float.toString(n);%0A    %7D%0A%0A    return null;%0A  %7D%0A%0A  /**%0A   * Converts a %7B@link Double%7D to a %7B@link String%7D, or null of the double is also null.%0A   */%0A  public static @Nullable String toString(@Nullable final Double n) %7B%0A    if (n != null) %7B%0A      return Double.toString(n);%0A    %7D%0A%0A    return null;%0A  %7D
 %0A%7D%0A

Add some helpers to shortcut converting numbers to strings