Add helper methods to meta/*Schema classes
Add the following helper methods to make error and type checking easier.
DatabaseSchema.getTables() - gets a List<String> of tables
DatabaseSchema.hasTable(String table) - returns true if the table exists
DatabaseSchema.getTable(String table) - returns the TableSchema object
TableSchema.getColumns() - gets a List<String> of columns
TableSchema.hasColumn(String column) - returns true if the column exists
TableSchema.getColumn(String column) - returns the ColumnSchema object
TableSchema.getColumnType(String column) - returns the ColumnType object
for the specified column
These calls are intended to be used for error/type checks. For example:
if (!device.hasTable("Open_vSwitch") {
throw RuntimeException("This is not the vswitchd schema")
}
Change-Id: If9dd286c05a38d7f60a0ce63cd3148157e3b345e
Signed-off-by: Dave Tucker <dave.j.tucker@hp.com>