code: public static long toLong(String str, long defaultValue) {
          if (str == null) {
              return defaultValue;
          }
          try {
              return Long.parseLong(str);
          } catch (NumberFormatException nfe) {
              return defaultValue;
          }
      }
docs: <p>
  Convert a <code>String</code> to an <code>long</code>, returning a default value if the conversion fails.
  </p>
  
  <p>
  If the string is <code>null</code>, the default value is returned.
  </p>
  
  <pre>
  NumberUtils.toLong(null, 1) = 1
  NumberUtils.toLong("", 1)   = 1
  NumberUtils.toLong("1", 0)  = 1
  </pre>
  
  @param str the string to convert, may be null
  @param defaultValue the default value
  @return the long represented by the string, or the default if conversion fails
  @since 2.1