@Test public void testGetValue() { final String expected = cellStringValue1; final String actual = index.getValue(cell1); assertEquals(expected, actual); }
String getValue(final GridCell<?> cell) { final GridCellValue<?> cellValue = cell.getValue(); if (cellValue != null) { final Object value = cellValue.getValue(); if (value instanceof HasNameAndDataTypeCell) { final HasNameAndDataTypeCell hasName = (HasNameAndDataTypeCell) value; return hasName.hasData() ? hasName.getName().getValue() : ""; } else if (value instanceof String || value instanceof Integer) { return String.valueOf(value); } } return ""; }
DMNGridSubIndex implements DMNSubIndex { String getValue(final GridCell<?> cell) { final GridCellValue<?> cellValue = cell.getValue(); if (cellValue != null) { final Object value = cellValue.getValue(); if (value instanceof HasNameAndDataTypeCell) { final HasNameAndDataTypeCell hasName = (HasNameAndDataTypeCell) value; return hasName.hasData() ? hasName.getName().getValue() : ""; } else if (value instanceof String || value instanceof Integer) { return String.valueOf(value); } } return ""; } }
DMNGridSubIndex implements DMNSubIndex { String getValue(final GridCell<?> cell) { final GridCellValue<?> cellValue = cell.getValue(); if (cellValue != null) { final Object value = cellValue.getValue(); if (value instanceof HasNameAndDataTypeCell) { final HasNameAndDataTypeCell hasName = (HasNameAndDataTypeCell) value; return hasName.hasData() ? hasName.getName().getValue() : ""; } else if (value instanceof String || value instanceof Integer) { return String.valueOf(value); } } return ""; } @Inject  DMNGridSubIndex(final DMNGridHelper dmnGridHelper); }
DMNGridSubIndex implements DMNSubIndex { String getValue(final GridCell<?> cell) { final GridCellValue<?> cellValue = cell.getValue(); if (cellValue != null) { final Object value = cellValue.getValue(); if (value instanceof HasNameAndDataTypeCell) { final HasNameAndDataTypeCell hasName = (HasNameAndDataTypeCell) value; return hasName.hasData() ? hasName.getName().getValue() : ""; } else if (value instanceof String || value instanceof Integer) { return String.valueOf(value); } } return ""; } @Inject  DMNGridSubIndex(final DMNGridHelper dmnGridHelper); @Override List<DMNSearchableElement> getSearchableElements(); @Override void onSearchClosed(); @Override void onNoResultsFound(); }
DMNGridSubIndex implements DMNSubIndex { String getValue(final GridCell<?> cell) { final GridCellValue<?> cellValue = cell.getValue(); if (cellValue != null) { final Object value = cellValue.getValue(); if (value instanceof HasNameAndDataTypeCell) { final HasNameAndDataTypeCell hasName = (HasNameAndDataTypeCell) value; return hasName.hasData() ? hasName.getName().getValue() : ""; } else if (value instanceof String || value instanceof Integer) { return String.valueOf(value); } } return ""; } @Inject  DMNGridSubIndex(final DMNGridHelper dmnGridHelper); @Override List<DMNSearchableElement> getSearchableElements(); @Override void onSearchClosed(); @Override void onNoResultsFound();  }