转换为long<br>
如果给定的值为空，或者转换失败，返回默认值<br>
转换失败不会报错

@param value 被转换的值
@param defaultValue 转换错误时的默认值
@return 结果
190667
public static Long toLong(Object value, Long defaultValue) {
		return convert(Long.class, value, defaultValue);
	}
1143286
public Double getDefaultOnNull(Double value, Double defaultValue)
   {
      return (value == null ? defaultValue : value);
   }
744771
public long getLong(String name, long defaultVal){
        if(this.configuration.containsKey(name)){
            return this.configuration.getLong(name);
        } else {
            return defaultVal;
        }
    }
811926
public static boolean isLongValue(final String value) {
        try {
            Long.parseLong(value);
            return true;
        } catch (final NumberFormatException ex) {
            return false;
        }
    }
1032177
public long readLong(long defaultValue, String attribute)
    {
        return Long.parseLong(getValue(String.valueOf(defaultValue), attribute));
    }
585040
public long getTotalBytesOnTiersOrDefault(
      java.lang.String key,
      long defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.Long> map =
        internalGetTotalBytesOnTiers().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
310918
public static Expression constant(final long value) {
    return new Expression(Type.LONG_TYPE, Feature.CHEAP) {
      @Override
      protected void doGen(CodeBuilder mv) {
        mv.pushLong(value);
      }
    };
  }
678887
public Long getParameterLong(String name, Long defaultValue)
   {
      String value = getParameterValue(name, null);

      if (value != null)
      {
         try
         {
            return StringNumberParser.parseLong(value);
         }
         catch (NumberFormatException e)
         {
            if (LOG.isTraceEnabled())
            {
               LOG.trace("An exception occurred: " + e.getMessage());
            }
         }
      }
      return defaultValue;
   }
255812
public static DefaultValueFunction defaultValue(Field field, Object defaultValue) {

		Assert.notNull(field, "Field must not be 'null' for default value operation.");

		return new DefaultValueFunction(field, defaultValue);
	}
162993
public Long getParaToLong(String name, Long defaultValue) {
		return toLong(request.getParameter(name), defaultValue);
	}
417022
public static Long getLong(final LdapEntry entry, final String attribute, final Long nullValue) {
        val v = getString(entry, attribute, nullValue.toString());
        if (NumberUtils.isCreatable(v)) {
            return Long.valueOf(v);
        }
        return nullValue;
    }
1173388
public LongConstant addLong(long value)
  {
    LongConstant entry = getLongByValue(value);

    if (entry != null)
      return entry;

    entry = new LongConstant(this, _entries.size(), value);

    addConstant(entry);
    addConstant(null);

    return entry;
  }
416620
public static String toDecimal(Object value, String defaultValue) {
	double res = toDoubleValue(value, true, Double.NaN);
	if (Double.isNaN(res)) return defaultValue;
	return toDecimal(res);
    }
1077359
public long getLong( String key, long defaultValue )
        throws MissingResourceException
    {
        try
        {
            return getLong( key );
        }
        catch( MissingResourceException mre )
        {
            return defaultValue;
        }
    }
1301667
public Long getLong(String key, String group, Long defaultValue) {
		return Convert.toLong(getByGroup(key, group), defaultValue);
	}
603919
public long getLong(String key, long defaultValue) {
    Object value = get(key);
    if (value instanceof Long) {
      return (long) value;
    }
    if (value instanceof Number) {
      return ((Number) value).longValue();
    } else if (value instanceof String) {
      try {
        return Long.valueOf((String) value);
      } catch (NumberFormatException ignored) {
      }
    }
    return defaultValue;
  }
481065
public static Object toNull(Object value, Object defaultValue) {
	if (value == null) return null;
	if (value instanceof String && Caster.toString(value, "").trim().length() == 0) return null;
	if (value instanceof Number && ((Number) value).intValue() == 0) return null;
	return defaultValue;
    }