Method for obtaining default value of required property
@param propName name of a property
@param returnType type of a property
@return default value for particular property
548984
protected Object getDefaultValue(String propName, Class<?> returnType)
	{
		Object ret = null;
		if(returnType.isPrimitive())
		{
			if(returnType.equals(boolean.class))
			{
				return false;
			}
			else if(returnType.equals(char.class))
			{
				return '\0';
			}
			else
			{
				try
				{
					Class<?> wrapperClass = Primitives.wrap(returnType);
					return wrapperClass.getMethod("valueOf", String.class).invoke(null, "0");
				} catch (Throwable e)
				{
					throw new WicketRuntimeException("Can't create default value for '"+propName+"' which should have type '"+returnType.getName()+"'");
				} 
			}
		}
		return ret;
	}
109142
function getPropDefaultValue (vm, prop, key) {
  // no default, return undefined
  if (!hasOwn(prop, 'default')) {
    return undefined
  }
  var def = prop.default;
  // warn against non-factory defaults for Object & Array
  if (isObject(def)) {
    warn(
      'Invalid default value for prop "' + key + '": ' +
      'Props with type Object/Array must use a factory function ' +
      'to return the default value.',
      vm
    );
  }
  // the raw prop value was also undefined from previous render,
  // return previous default value to avoid unnecessary watcher trigger
  if (vm && vm.$options.propsData &&
    vm.$options.propsData[key] === undefined &&
    vm._props[key] !== undefined
  ) {
    return vm._props[key]
  }
  // call factory function for non-Function types
  // a value is Function if its prototype is function even across different execution context
  return typeof def === 'function' && getType(prop.type) !== 'Function'
    ? def.call(vm)
    : def
}
191409
public String getConfigProperty(String propertyName, String defaultValue) {
        return getConfig().getString(propertyName, defaultValue);
    }
803543
protected <T> T invokeJavascriptReturnValue(String function, Class<T> returnType) {
        Object returnObject = invokeJavascript(function);
        if (returnObject instanceof JSObject) {
            try {
                Constructor<T> constructor = returnType.getConstructor(JSObject.class);
                return constructor.newInstance((JSObject) returnObject);
            } catch (Exception ex) {
                throw new IllegalStateException(ex);
            }
        } else {
            return (T) returnObject;
        }
    }
1308189
public static String getDefaultValueForType( JType type ) {
        JPrimitiveType primitiveType = type.isPrimitive();
        if ( null != primitiveType ) {
            return primitiveType.getUninitializedFieldExpression();
        }
        return "null";
    }
653674
public static String getProperty(final String propName) {
        try {
            return System.getProperty(propName);
        } catch (final SecurityException e) {
            return null;
        }
    }
539712
@SuppressWarnings("unchecked")
    public static Object defaultValue(Type type) {
        Validate.argumentIsNotNull(type);

        return DEFAULTS.get(type);
    }
701758
public Object get(String propName) {
        if (propName.equals("value")) {
            return getValue();
        }
        if (propName.equals("lang")) {
            return getLang();
        }
        return null;
    }
1097289
public static String getEnvDefault(String propName, String defaultVal) {
        String ans = defaultVal;
        String value = System.getenv(propName);
        if (value != null) {
            ans = value.trim();
        } else if (defaultVal != null) {
            ans = defaultVal.trim();
        }
        return ans;
    }
710788
protected <T> T getProperty(String key, Class<T> type) {
        Object returnValue = getProperty(key);
        if (returnValue != null) {
            return (T) returnValue;
        } else {
            return null;
        }
    }
791906
public static String getDefaultMediaType(ResultType expectedType) {
    ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null;
    
    // If the expected type is unknown, we should let the server decide, otherwise we could
    // wind up requesting a response type that doesn't match the actual resuts (e.g. xml with CONSTRUCT).
    // TODO: We could include multiple media types in the Accept: field, but that assumes that the
    // server has proper support for content negotiation. Many servers only look at the first value.
    return (format != null) ? format.mimeText : null;
  }
238602
public com.google.api.Property.PropertyType getType() {
    @SuppressWarnings("deprecation")
    com.google.api.Property.PropertyType result = com.google.api.Property.PropertyType.valueOf(type_);
    return result == null ? com.google.api.Property.PropertyType.UNRECOGNIZED : result;
  }
1104793
public Collection<Object> getPropertyOrDefault(final String name, final Object defaultValue) {
        return getPropertyOrDefault(name, CollectionUtils.wrapList(defaultValue));
    }
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.");
        }
    }
558506
@Pure
	public String getDefaultValueForType(String type) {
		//TODO: Check if a similar function exists in the Xbase library.
		String defaultValue = "";
		if (!Strings.isEmpty(type) && !"void".equals(type)) {
			switch (type) {
			case "boolean":
				defaultValue = "true";
				break;
			case "double":
				defaultValue = "0.0";
				break;
			case "float":
				defaultValue = "0.0f";
				break;
			case "int":
				defaultValue = "0";
				break;
			case "long":
				defaultValue = "0";
				break;
			case "byte":
				defaultValue = "(0 as byte)";
				break;
			case "short":
				defaultValue = "(0 as short)";
				break;
			case "char":
				defaultValue = "(0 as char)";
				break;
			default:
				defaultValue = "null";
				break;
			}
		}
		return defaultValue;
	}
451104
public static boolean isPropertyOfType(Class<?> clazz, String propertyName, Class<?> type) {
        try {
            Class<?> propType = getPropertyType(clazz, propertyName);
            return propType != null && propType.equals(type);
        }
        catch (Exception e) {
            return false;
        }
    }
1258192
static String[] getProp(final Map<String, String[]> prop, final String propertyName) {
        String[] result = null;
        if (prop != null) {
            for (final Entry<String, String[]> entry : prop.entrySet()) {
                if (entry.getKey().equalsIgnoreCase(propertyName)) {
                    result = entry.getValue();
                }
            }
        }
        return result;
    }