@Override public void set(Row value) { map.clear(); for(int i = 0; i < value.length(); ++i) { map.put(value.getColumn(i), value.getValue(i)); } }
@Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { for (int i = 0; i < row.length(); ++i) { String column = row.getColumn(i); // Trims column = column.trim(); // Lower case columns column = column.toLowerCase(); // Filtering unwanted characters column = column.replaceAll("[^a-zA-Z0-9_]", "_"); row.setColumn(i, column); } } return rows; } }
@Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { for (int i = 0; i < row.length(); ++i) { String name = row.getColumn(i); if (toLower) { row.setColumn(i, name.toLowerCase()); } else { row.setColumn(i, name.toUpperCase()); } } } return rows; } }
@Override public List<Row> execute(List<Row> rows, ExecutorContext context) throws DirectiveExecutionException { for (Row row : rows) { for (int i = 0; i < row.length(); ++i) { String name = row.getColumn(i); try { Unix4jCommandBuilder builder = Unix4j.echo(name).sed(sed); row.setColumn(i, builder.toStringResult()); } catch (IllegalArgumentException e) { throw new DirectiveExecutionException( String.format(toString() + " : " + e.getMessage()) ); } } } return rows; } }
++count; for (int i = 0; i < row.length(); ++i) { String column = row.getColumn(i); Object object = row.getValue(i);