Find out whether the value of a business object's attribute is null.
Syntax
boolean isNull(String attribute)
Parameters
Return values
Returns true if the attribute value is null; returns false if it is not null.
Notes
A null indicates no value, in contrast to a zero-length string value, which is detected by calling isBlank(). Test an object with isNull() before using it, because if the object is null, the operation could fail.
An attribute value can be null under these circumstances:
An attribute value can be set to null using the set() method.
At instantiation of a new business objects, all attribute values are initialized with a null. If the attribute value has not been set between the time of creation and the time of the isNull() call, the value is still null.
When a collaboration is processing a business object received from a connector, the mapping process might have inserted the null. The mapping process converts the application-specific business object received from the connector to the generic business object handled by the collaboration. For each attribute in the generic business object that has no equivalent in the application-specific object, the map inserts a null value.
Examples
The following example checks whether the Material attribute of the sourcePaperClip business object has a null value.
boolean key = sourcePaperClip.isNull("Material");
The following example checks whether the CustAddr attribute of the contract1 business object is null before retrieving it. The attribute retrieval proceeds only if the isNull() check is false, showing that the attribute is not null.
if (! contract1.isNull("CustAddr")) { BusObj customerAddress = contract1.getBusObj("CustAddr"); //do something with the "customerAddress" business object }