/** * Constructor * * @param table The name of the database table containing this row. * @param columns A list of column names. Each member of the List is a String. After construction, * the list of columns is fixed; attempting to access a column not in the list will cause an * IllegalArgumentException to be thrown. */ public TableRow(String table, List<String> columns) { this.table = table; for (String column : columns) { String canonicalized = ColumnInfo.canonicalize(column); data.put(canonicalized, NULL_OBJECT); changed.put(canonicalized, Boolean.TRUE); } }
private String canonicalizeAndCheck(String column) { if (data.containsKey(column)) { return column; } String canonicalized = ColumnInfo.canonicalize(column); if (data.containsKey(canonicalized)) { return canonicalized; } throw new IllegalArgumentException("No such column '" + canonicalized + "'"); }
/** * Return true if this row contains this column and the value has been updated. * * @param column The column name (case-insensitive) * @return True if this row contains a column with this name. */ public boolean hasColumnChanged(String column) { return hasColumnChangedCanonicalized(ColumnInfo.canonicalize(column)); }