1ST WAY USAGE:
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
2ND WAY USAGE:
( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
? "HAVING NULL" : "HAVING DATA"
=======================================================
Below is the Tested Talend code in DETAIL with various ways of NULL data:
=======================================================
String test_string="TALEND";
System.out.println("\ntest_string=\"TALEND\";");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
test_string="null";
System.out.println("\ntest_string=\"null\";");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
test_string="";
System.out.println("\ntest_string=\"\";");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
test_string=null;
System.out.println("\ntest_string=null;");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
2ND WAY USAGE:
( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
? "HAVING NULL" : "HAVING DATA"
=======================================================
Below is the Tested Talend code in DETAIL with various ways of NULL data:
=======================================================
String test_string="TALEND";
System.out.println("\ntest_string=\"TALEND\";");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
test_string="null";
System.out.println("\ntest_string=\"null\";");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
test_string="";
System.out.println("\ntest_string=\"\";");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");
test_string=null;
System.out.println("\ntest_string=null;");
if( (Relational.ISNULL(test_string)) || ("null".equals(test_string)) || ("".equals(test_string)) )
System.out.println("HAS GOT A NULL VALUE ");
else
System.out.println("HAS GOT A VALID VALUE ");