@Test public void testGetPortNameIntMapOfStringString() { assertEquals("A", SpreadsheetUtils.getPortName(0, null)); assertEquals("AA", SpreadsheetUtils.getPortName(26, null)); ObjectNode configuration = JsonNodeFactory.instance.objectNode(); ArrayNode columnNames = configuration.arrayNode(); columnNames.addObject().put("column", "D").put("port", "delta"); configuration.put("columnNames", columnNames); assertEquals("delta", SpreadsheetUtils.getPortName(3, configuration)); assertEquals("AB", SpreadsheetUtils.getPortName(27, configuration)); }
public static String getPortName(String columnLabel, JsonNode jsonNode) { String portName = columnLabel; if (jsonNode != null && jsonNode.has("columnNames")) { for (JsonNode mappingNode : jsonNode.get("columnNames")) { if (columnLabel.equals(mappingNode.get("column").textValue())) { portName = mappingNode.get("port").textValue(); break; } } } return portName; }
SpreadsheetUtils { public static String getPortName(String columnLabel, JsonNode jsonNode) { String portName = columnLabel; if (jsonNode != null && jsonNode.has("columnNames")) { for (JsonNode mappingNode : jsonNode.get("columnNames")) { if (columnLabel.equals(mappingNode.get("column").textValue())) { portName = mappingNode.get("port").textValue(); break; } } } return portName; } }
SpreadsheetUtils { public static String getPortName(String columnLabel, JsonNode jsonNode) { String portName = columnLabel; if (jsonNode != null && jsonNode.has("columnNames")) { for (JsonNode mappingNode : jsonNode.get("columnNames")) { if (columnLabel.equals(mappingNode.get("column").textValue())) { portName = mappingNode.get("port").textValue(); break; } } } return portName; }  }
SpreadsheetUtils { public static String getPortName(String columnLabel, JsonNode jsonNode) { String portName = columnLabel; if (jsonNode != null && jsonNode.has("columnNames")) { for (JsonNode mappingNode : jsonNode.get("columnNames")) { if (columnLabel.equals(mappingNode.get("column").textValue())) { portName = mappingNode.get("port").textValue(); break; } } } return portName; }  static int getColumnIndex(String column); static String getColumnLabel(int column); static String getPortName(String columnLabel, JsonNode jsonNode); static String getPortName(int columnIndex, JsonNode jsonNode); static Range getRange(JsonNode jsonNode); }
SpreadsheetUtils { public static String getPortName(String columnLabel, JsonNode jsonNode) { String portName = columnLabel; if (jsonNode != null && jsonNode.has("columnNames")) { for (JsonNode mappingNode : jsonNode.get("columnNames")) { if (columnLabel.equals(mappingNode.get("column").textValue())) { portName = mappingNode.get("port").textValue(); break; } } } return portName; }  static int getColumnIndex(String column); static String getColumnLabel(int column); static String getPortName(String columnLabel, JsonNode jsonNode); static String getPortName(int columnIndex, JsonNode jsonNode); static Range getRange(JsonNode jsonNode);  }