Java - Assert (Inline code Assertion)



assert Expression1 : Expression2 ;


  • Expression1 is a boolean expression.
  • Expression2 is an expression that has a value. (It cannot be an invocation of a method that is declared void.)


// TypeCode or Java Class must be present
assert !(columnMetadata.getColumnTypeCode() == null && columnMetadata.getColumnTypeJava() == null) : "The column (" + columnMetadata.getColumnName() + ") has its type code and java type Null";
java.lang.AssertionError: The column (column1) has its type code and java type Null

	at net.bytle.table.database.Databases.getDataTypeOf(
	at net.bytle.table.database.Databases.getCreateTableStatementColumnsDefinition(
	at net.bytle.table.database.Databases.getCreateTableStatement(
	at net.bytle.table.TableLoader.TableLoader.<init>(
	at net.bytle.table.TableLoader.TableLoaderSqliteTest.dataLoadTest(

Powered by ComboStrap