Use of wrapper classes

The practical difference between wrapper classes and native classes

 

Although JAVA's automatic packaging and unpacking can make Integet and int equivalent, there are still differences.

 

encountered an error,

public Boolean getIsSetNetParam() {
		return isSetNetParam;
	}

	public void setIsSetNetParam(Boolean isSetNetParam) {
		this.isSetNetParam = isSetNetParam;
	}

 If Boolean is changed to boolean, then if isSetNetParam is Null, an error will be reported, unless an if judgment is made to ensure that null is false. Better to just use Boolean. This error occurs when Jackson serializes if the value is null.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327106340&siteId=291194637