get property value as long.
@param props  The properties
@param propertyName  property name
@param defaultValue  The default value
@return property value
325803
public static long getPropertyAsLong(Properties props, String propertyName, long defaultValue) {
        String value = props.getProperty(propertyName, "").trim();
        if (value.isEmpty()) {
            return defaultValue;
        }
        try {
            long val = Long.parseLong(value);
            if (val <= 0) {
                throw new IllegalArgumentException(
                        "Value of " + propertyName + " should be positive, but current value is " + val);
            }
            return val;
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException(
                    "Property " + propertyName + " must be a number in Kinesis importer configuration.");
        }
    }
168541
public String getProperty(String key, String defaultValue) {
        String val = properties.get(key);

        if (val == null) {
            val = defaultValue;
        }

        return val;
    }
273894
public static Long getValue(final Long value, final Long defaultValue) {

    return value == null ? defaultValue : value;
  }
1236861
public long getLong(Enum<?> key, long defaultValue)
    {
        if (key == null)
        {
            return defaultValue;
        }

        return getLong(key.name(), defaultValue);
    }
1299281
public static boolean getBooleanValue(Properties prop, String name, boolean defaultValue) {
		String strProp = prop.getProperty(name, Boolean.toString(defaultValue));
		return Boolean.valueOf(strProp);
	}
1326205
public static String getProperty(Properties props, String propertyName, String defaultValue) {
        String value = props.getProperty(propertyName, defaultValue).trim();
        if (value.isEmpty()) {
            throw new IllegalArgumentException(
                    "Property " + propertyName + " is missing in Kinesis importer configuration.");
        }
        return value;
    }
1106501
public String getProperty(String key, String defaultValue) {
        return mProperties.getProperty(key, defaultValue);
    }
329326
public static int getOptionalDataSizeProperty(ServiceProperties properties, String propertyName, int defaultValue) {
        String value = getOptionalProperty(properties, propertyName, Integer.toString(defaultValue));
        return Utils.parseDataSize(value);
    }
946059
public static long getLong(JsonObject object, String field, long defaultValue) {
        final JsonValue value = object.get(field);
        if (value == null || value.isNull()) {
            return defaultValue;
        } else {
            return value.asLong();
        }
    }
285162
public Object getPropertyValue(Property property) {
        Validate.argumentIsNotNull(property);
        Object val = properties.get(property.getName());
        if (val == null){
            return Defaults.defaultValue(property.getGenericType());
        }
        return val;
    }
1069927
public boolean getBooleanProperty(String propertyName, boolean defaultValue) {

		return Boolean.valueOf(getProperty(propertyName, Boolean.toString(defaultValue)));
	}
1256333
public static Object getProperty(Object obj, String prop, Object defaultValue) {

	// first try field
	Field[] fields = getFieldsIgnoreCase(obj.getClass(), prop, null);
	if (!ArrayUtil.isEmpty(fields)) {
	    try {
		return fields[0].get(obj);
	    }
	    catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
	    }
	}

	// then getter
	try {
	    char first = prop.charAt(0);
	    if (first >= '0' && first <= '9') return defaultValue;
	    return getGetter(obj.getClass(), prop).invoke(obj);
	}
	catch (Throwable e1) {
	    ExceptionUtil.rethrowIfNecessary(e1);
	    return defaultValue;
	}
    }
712060
public String getRequiredConfigAttributeWithDefaultValueAndConfigId(Map<String, Object> props, String key, String defaultValue, String configId) {
        String result = getAndTrimConfigAttribute(props, key);
        if (key != null && result == null) {
            if (defaultValue != null) {
                result = defaultValue;
            } else {
                logMessageForMissingRequiredAttribute(key, configId);
            }
        }
        return result;
    }
1190098
public double getProperty(String propName, double defaultValue) {
        String propValue = props.getProperty(propName);
        return (propValue == null) ? defaultValue : Double.parseDouble(propValue);
    }
338633
public Collection<Object> getPropertyOrDefault(final String name, final Collection<Object> defaultValues) {
        if (this.properties.containsKey(name)) {
            return this.properties.get(name);
        }
        return defaultValues;
    }
447342
public long getLong(String property) {
    return getProperty(property, value -> {
      try {
        return Long.valueOf(value);
      } catch (NumberFormatException e) {
        throw new ConfigurationException("malformed property value: " + property + " must be a long");
      }
    });
  }
695619
public MYSELF defaultValueProperty(String... properties) {
		for (String prop : properties) {
			String propertyKey = BuilderUtils.isExpression(prop) ? BuilderUtils.getPropertyKey(prop) : prop;
			this.defaultValueProperties.add(propertyKey);
		}
		return myself;
	}