isBlank()

Find out whether the value of an attribute is set to a zero-length string.

Syntax

boolean isBlank(String attribute)
 

Parameters

attribute
The name of an attribute.

Returns

Returns true if the attribute value is a zero-length string; returns false otherwise.

Notes

A zero-length string can be compared to the string "". It is different from a null, whose presence is detected by the isNull() method.

If a collaboration needs to retrieve an attribute value and then do something with it, it can call isBlank() and isNull() to check that it has a value before retrieving the value.

Examples

The following example checks whether the Material attribute of the sourcePaperClip business object is a zero-length string.

boolean key = sourcePaperClip.isBlank("Material");
 

Copyright IBM Corp. 1997, 2003