private boolean invokePrimitiveMethod()

in spring-cloud-alibaba-starters/spring-alibaba-nacos-config/src/main/java/com/alibaba/cloud/nacos/annotation/NacosAnnotationProcessor.java [653:689]


	private boolean invokePrimitiveMethod(Method method, Object bean, String value) throws Exception {
		Class<?> parameterType = method.getParameterTypes()[0];
		if (parameterType == int.class) {
			ReflectionUtils.invokeMethod(method, bean, Integer.parseInt(value));
		}
		else if (parameterType == Integer.class) {
			ReflectionUtils.invokeMethod(method, bean, Integer.valueOf(value));
		}
		else if (parameterType == long.class) {
			ReflectionUtils.invokeMethod(method, bean, Long.parseLong(value));
		}
		else if (parameterType == Long.class) {
			ReflectionUtils.invokeMethod(method, bean, Long.valueOf(value));
		}
		else if (parameterType == boolean.class) {
			ReflectionUtils.invokeMethod(method, bean, Boolean.parseBoolean(value));
		}
		else if (parameterType == Boolean.class) {
			ReflectionUtils.invokeMethod(method, bean, Boolean.valueOf(value));
		}
		else if (parameterType == double.class) {
			ReflectionUtils.invokeMethod(method, bean, Double.parseDouble(value));
		}
		else if (parameterType == Double.class) {
			ReflectionUtils.invokeMethod(method, bean, Double.valueOf(value));
		}
		else if (parameterType == float.class) {
			ReflectionUtils.invokeMethod(method, bean, Float.parseFloat(value));
		}
		else if (parameterType == Float.class) {
			ReflectionUtils.invokeMethod(method, bean, Float.valueOf(value));
		}
		else {
			return false;
		}
		return true;
	}