Replies the value of the type system property.

@param <S>
- type to reply.
@param type
- type to reply.
@param name
- name of the property.
@param defaultValue
- value to reply if the these is no property found
@return the value, or defaultValue.
15922
public static <S> Class<? extends S> getSystemPropertyAsClass(Class<S> type, String name, String defaultValue) {
        final String value = getSystemProperty(name, null);
        if (value != null) {
            try {
                final Class<?> typeInstance = Class.forName(value);
                if (typeInstance != null) {
                    return typeInstance.asSubclass(type);
                }
            } catch (Throwable exception) {
                //
            }
        }
        if (defaultValue != null) {
            try {
                final Class<?> typeInstance = Class.forName(defaultValue);
                if (typeInstance != null) {
                    return typeInstance.asSubclass(type);
                }
            } catch (Throwable exception) {
                //
            }
        }
        return null;
    }
366148
@SuppressWarnings("unchecked")
    public static <T> T getJlsDefaultValue(Class<T> type) {
        if(!type.isPrimitive()) {
           return null;
        }
        return (T) JLS_PRIMITIVE_DEFAULT_VALUES.get(type);
    }
591538
public static <T> T getOrDefaultValue(String primaryKey, T defaultValue) {
        Object val = CFG.get(primaryKey);
        return val == null ? defaultValue : (T) CompatibleTypeUtils.convert(val, defaultValue.getClass());
    }
167118
public char getChar(String name, char defaultValue) {
        String value = getString(name, null);
        if (!StringUtils.isNullOrEmpty(value)) {
            return value.trim().charAt(0);
        }

        return defaultValue;
    }
521542
public Collection<Object> getPropertyOrDefault(final String name, final Object... defaultValues) {
        if (this.properties.containsKey(name)) {
            return this.properties.get(name);
        }
        return Arrays.stream(defaultValues).collect(Collectors.toList());
    }
473084
public static Object defaultValue(final Class<?> type) {
	final Object value = WRAPPER_DEFAULTS.get(Objects.requireNonNull(type));
	if (value == null) {
	    throw new IllegalArgumentException("Not primitive wrapper");
	}
	return value;
    }
220238
public Object getFieldDefaultValue(TypeElement type, String name) {
		return this.defaultValues.computeIfAbsent(type, this::resolveFieldValues)
				.get(name);
	}
572995
public static Integer getInteger(String name, Integer defaultValue) {
		return Integer.getInteger(name, defaultValue);
	}
1114626
public static int getSystemPropertyAsInteger(String name, int defaultValue) {
        final String value = getSystemProperty(name, null);
        if (value != null) {
            try {
                return Integer.parseInt(value);
            } catch (Throwable exception) {
                //
            }
        }
        return defaultValue;
    }
1225160
public Integer getCookieToInt(String name, Integer defaultValue) {
		String result = getCookie(name);
		return result != null ? Integer.parseInt(result) : defaultValue;
	}
1301932
static String getSystemProperty(final String name, final String defaultValue)
   {
      PrivilegedAction<String> action = new PrivilegedAction<String>()
      {
         public String run()
         {
            return System.getProperty(name, defaultValue);
         }
      };
      return AccessController.doPrivileged(action);
   }
526508
public String getValueWithDefault(String keyMsgType, String defaultVal) {
        return keyToValue.getOrDefault(keyMsgType, defaultVal);
    }
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;
   }
1323269
public <R> R getHeader(String name, R defaultValue) {
        if (headers().contains(name)) {
            return getHeader(name);
        } else {
            return defaultValue;
        }
    }
1364108
public boolean getBooleanValue(String name, boolean defaultValue) {

        String value = getValue(name);

        if (value == null) {
            return defaultValue;
        } else {
            return value.equals("true");
        }
    }
811508
public int getAsInt(final String name, final int defaultValue) {
        return AtsdUtil.getPropertyIntValue(fullName(name), clientProperties, defaultValue);
    }
676099
public String getString(String name, String defaultValue) {
        String value = getProperties().getProperty(name, defaultValue);
        value = overrides.getProperty(name, value);

        return value;
    }