@Test public void testThatContainsColumnMethodReturnsFalseWhenColumnDoesNotExist() { Table table = new Table("users"); assertFalse(table.containsColumn("id")); }
public boolean containsColumn(String columnName) { checkArgument(!Strings.isNullOrEmpty(columnName), "You must specify a 'name'."); return columns.stream() .filter(c -> c.getName().equals(columnName)) .findFirst() .isPresent(); }
Table implements Copyable<Table>, Comparable<Table> { public boolean containsColumn(String columnName) { checkArgument(!Strings.isNullOrEmpty(columnName), "You must specify a 'name'."); return columns.stream() .filter(c -> c.getName().equals(columnName)) .findFirst() .isPresent(); } }
Table implements Copyable<Table>, Comparable<Table> { public boolean containsColumn(String columnName) { checkArgument(!Strings.isNullOrEmpty(columnName), "You must specify a 'name'."); return columns.stream() .filter(c -> c.getName().equals(columnName)) .findFirst() .isPresent(); } Table(String name); }
Table implements Copyable<Table>, Comparable<Table> { public boolean containsColumn(String columnName) { checkArgument(!Strings.isNullOrEmpty(columnName), "You must specify a 'name'."); return columns.stream() .filter(c -> c.getName().equals(columnName)) .findFirst() .isPresent(); } Table(String name); Table addIndex(Index index); boolean containsIndex(String... columns); boolean containsIndex(Collection<String> columns); Index removeIndex(String... columns); Index removeIndex(Collection<String> columns); Index getIndex(String... columns); Index getIndex(Collection<String> columns); ImmutableList<Index> getIndexes(); Table addColumn(Column column); Table addColumns(Collection<Column> newColumns); Column getColumn(String columnName); List<Column> getIdentityColumns(); boolean containsColumn(String columnName); Column removeColumn(String columnName); ImmutableList<Column> getColumns(); ForeignKeyBuilder addForeignKey(String... referringColumns); ForeignKeyBuilder addForeignKey(List<String> referringColumns); Table rename(String newName); boolean referencesTable(String tableName); Set<String> enumerateReferencedByTables(); @Override Table copy(); @Override int compareTo(Table o); @Override String toString(); }
Table implements Copyable<Table>, Comparable<Table> { public boolean containsColumn(String columnName) { checkArgument(!Strings.isNullOrEmpty(columnName), "You must specify a 'name'."); return columns.stream() .filter(c -> c.getName().equals(columnName)) .findFirst() .isPresent(); } Table(String name); Table addIndex(Index index); boolean containsIndex(String... columns); boolean containsIndex(Collection<String> columns); Index removeIndex(String... columns); Index removeIndex(Collection<String> columns); Index getIndex(String... columns); Index getIndex(Collection<String> columns); ImmutableList<Index> getIndexes(); Table addColumn(Column column); Table addColumns(Collection<Column> newColumns); Column getColumn(String columnName); List<Column> getIdentityColumns(); boolean containsColumn(String columnName); Column removeColumn(String columnName); ImmutableList<Column> getColumns(); ForeignKeyBuilder addForeignKey(String... referringColumns); ForeignKeyBuilder addForeignKey(List<String> referringColumns); Table rename(String newName); boolean referencesTable(String tableName); Set<String> enumerateReferencedByTables(); @Override Table copy(); @Override int compareTo(Table o); @Override String toString();  }