/*
Gets the integer from the properties.

@param key the key of the property.

@return the value of the key. return -1 if the value is not found.
502162
public Integer getInteger(String key){
        try {
            return Integer.valueOf(resource.getString(key));
        } catch (MissingResourceException e) {
            return new Integer(-1);
        }
    }
736921
public int getProperty(String key, int defaultValue) {
        String value = getProperty(key, String.class);
        return StringUtils.isEmpty(value) ? defaultValue : Integer.parseInt(value);
    }
1119744
@Override
	public Integer getPropertyInteger(Class<?> cls, String key,
			Integer aDefault)
	{
		return getPropertyInteger(new StringBuilder(cls.getName()).append(".").append(key).toString(), aDefault);

	}
973444
public int getInt(String key) {
    String value = getString(key);
    if (StringUtils.isNotEmpty(value)) {
      return Integer.parseInt(value);
    }
    return 0;
  }
185468
@Override
    public V get(Object key) {
        final int index = key == null ? indexOfNull() : indexOf(key, key.hashCode());
        return index >= 0 ? (V)mArray[(index<<1)+1] : null;
    }
530567
@Override
    public int getInt(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        synchronized (lock) {
            return CBLConverter.asInteger(getMValue(internalDict, key), internalDict);
        }
    }
40324
@Override
	public Integer getPropertyInteger(String key)
	{
		Integer iVal = null;
		String sVal = getProperty(key);

		if ((sVal != null) && (sVal.length() > 0))
		{

			iVal = Integer.valueOf(sVal);

		}
		return iVal;

	}
978990
public Number getNumberProperty(String key) {
    JsonElement propertyKey = properties().get(key);
    return propertyKey == null ? null : propertyKey.getAsNumber();
  }
529228
@Override
    public int getInt(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        final int index = indexForColumnName(key);
        return index >= 0 ? getInt(index) : 0;
    }
499201
public Integer getAsNullableInteger(String key) {
		Object value = getAsObject(key);
		return IntegerConverter.toNullableInteger(value);
	}
1317360
public static long getInt(String key, int valueIfNullOrNotParseable) {
        String value = System.getProperty(key);
        if (Strings.isNullOrEmpty(value)) {
            return valueIfNullOrNotParseable;
        }
        try {
            return Integer.parseInt(value);
        } catch (NumberFormatException e) {
            return valueIfNullOrNotParseable;
        }
    }
1289244
public static int getInt ( Properties props, String key, int def ) {
        String s = props.getProperty(key);
        if ( s != null ) {
            try {
                def = Integer.parseInt(s);
            }
            catch ( NumberFormatException nfe ) {
                log.error("Not a number", nfe);
            }
        }
        return def;
    }
315648
public int getInt(final String key) {
		final String value = getProperty(key);
		if (value == null) {
			throw new NumberFormatException("Couldn't parse property to int.");
		}
		return Integer.parseInt(value);
	}
1258145
public int getInteger(String key, int defaultValue) {
        int result = defaultValue;
        try {
            if (key != null)
                result = getInteger(key);
        } catch (MissingResourceException e) {
        }
        return result;
    }
58368
public Integer getInteger(String key, Integer def) {
        String value = getString(key);
        if (value == null) {
            return def;
        }
        else {
            try {
                return Integer.valueOf(value);
            }
            catch (NumberFormatException e) {
            }
            return def;
        }
    }
765839
public int getInt(String key) throws JSONException {
    Object o = get(key);
    try {
      return o instanceof Number ? ((Number) o).intValue() : Integer.parseInt((String) o);
    } catch (Exception e) {
      throw new JSONException("JSONObject[" + quote(key) + "] is not an int.");
    }
  }
497241
public int getIndexByString(String key) {
        int index = -1;
        for (T value : values) {
            index++;
            if (keyFactory.generateKey(value).equals(key)) {
                return index;
            }
        }
        return index;
    }