com.jgoodies.forms.util
public final class FormUtils extends Object
Since: 1.2
Version: $Revision: 1.5 $
Method Summary | |
---|---|
static void | assertNotBlank(String text, String description)
Throws an exception if the specified text is blank using the given
text description.
|
static void | assertNotNull(Object object, String description)
Throws an NPE if the given object is {@code null} that uses
the specified text to describe the object.
|
static boolean | equals(Object o1, Object o2)
Checks and answers if the two objects are
both {@code null} or equal.
|
static boolean | isBlank(String str)
Checks and answers if the given string is whitespace, empty (""),
or {@code null}.
|
static boolean | isLafAqua()
Lazily checks and answers whether the Aqua look&feel is active.
|
static boolean | isNotBlank(String str)
Checks and answers if the given string is not empty (""),
not {@code null} and not whitespace only.
|
Parameters: text the text to check description describes the text, used in the exception message
Throws: NullPointerException if {@code text} is {@code null} IllegalArgumentException if {@code text} is empty, or blank
Parameters: object the text to check description describes the object, used in the exception message
Throws: NullPointerException if {@code object} is {@code null}
#equals(null, null) == true #equals("Hi", "Hi") == true #equals("Hi", null) == false #equals(null, "Hi") == false #equals("Hi", "Ho") == false
Parameters: o1 the first object to compare o2 the second object to compare
Returns: boolean {@code true} if and only if both objects are {@code null} or equal
FormUtils.isBlank(null) == true FormUtils.isBlank("") == true FormUtils.isBlank(" ") == true FormUtils.isBlank(" abc") == false FormUtils.isBlank("abc ") == false FormUtils.isBlank(" abc ") == false
Parameters: str the string to check, may be{@code null}
Returns: {@code true} if the string is whitespace, empty, or {@code null}
Returns: {@code true} if the current look&feel is Aqua
FormUtils.isNotBlank(null) == false FormUtils.isNotBlank("") == false FormUtils.isNotBlank(" ") == false FormUtils.isNotBlank(" abc") == true FormUtils.isNotBlank("abc ") == true FormUtils.isNotBlank(" abc ") == true
Parameters: str the string to check, may be {@code null}
Returns: {@code true} if the string is not empty and not {@code null} and not whitespace only