@Test public void valueOrDefault() { assertThat(DatasetImporterForMetaTable.valueOrDefault(null, new DatasetImporterForMetaTable.Column("foo", "bar")), is(nullValue())); final DatasetImporterForMetaTable.Column columnWithDefault = new DatasetImporterForMetaTable.Column("foo", "bar"); columnWithDefault.setDefaultValue("bla"); assertThat(DatasetImporterForMetaTable.valueOrDefault(null, columnWithDefault), is("bla")); assertThat(DatasetImporterForMetaTable.valueOrDefault("boo", columnWithDefault), is("boo")); }
public static String valueOrDefault(String value, Column column) { return (value == null && StringUtils.isNotBlank(column.getDefaultValue())) ? column.getDefaultValue() : value; }
DatasetImporterForMetaTable extends DatasetImporterWithListener { public static String valueOrDefault(String value, Column column) { return (value == null && StringUtils.isNotBlank(column.getDefaultValue())) ? column.getDefaultValue() : value; } }
DatasetImporterForMetaTable extends DatasetImporterWithListener { public static String valueOrDefault(String value, Column column) { return (value == null && StringUtils.isNotBlank(column.getDefaultValue())) ? column.getDefaultValue() : value; } DatasetImporterForMetaTable(ParserFactory parserFactory, NodeFactory nodeFactory); }
DatasetImporterForMetaTable extends DatasetImporterWithListener { public static String valueOrDefault(String value, Column column) { return (value == null && StringUtils.isNotBlank(column.getDefaultValue())) ? column.getDefaultValue() : value; } DatasetImporterForMetaTable(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); static void append(StringBuilder citation, String value, String suffix, String prefix); static void append(StringBuilder citation, String value, String continuation); static InteractType generateInteractionType(Map<String, String> properties, InteractTypeMapper mapper); JsonNode getConfig(); String getBaseUrl(); static void importAll(InteractionListener interactionListener,
                                 List<Column> columnNames,
                                 CSVParse csvParse, JsonNode config, ImportLogger importLogger); static void parseColumnValue(ImportLogger importLogger, Map<String, String> mappedLine, String value, Column column); static void logParseWarning(ImportLogger importLogger, Map<String, String> mappedLine, String value, Column column); static String valueOrDefault(String value, Column column); static void setInteractionType(Map<String, String> properties, InteractType type); static String parseValue(String value, Column column); void setDataset(Dataset dataset); Dataset getDataset(); static List<Column> columnNamesForMetaTable(JsonNode config); static List<Column> columnNamesForSchema(JsonNode tableSchema); static Column createStringColumn(JsonNode columnName); }
DatasetImporterForMetaTable extends DatasetImporterWithListener { public static String valueOrDefault(String value, Column column) { return (value == null && StringUtils.isNotBlank(column.getDefaultValue())) ? column.getDefaultValue() : value; } DatasetImporterForMetaTable(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); static void append(StringBuilder citation, String value, String suffix, String prefix); static void append(StringBuilder citation, String value, String continuation); static InteractType generateInteractionType(Map<String, String> properties, InteractTypeMapper mapper); JsonNode getConfig(); String getBaseUrl(); static void importAll(InteractionListener interactionListener,
                                 List<Column> columnNames,
                                 CSVParse csvParse, JsonNode config, ImportLogger importLogger); static void parseColumnValue(ImportLogger importLogger, Map<String, String> mappedLine, String value, Column column); static void logParseWarning(ImportLogger importLogger, Map<String, String> mappedLine, String value, Column column); static String valueOrDefault(String value, Column column); static void setInteractionType(Map<String, String> properties, InteractType type); static String parseValue(String value, Column column); void setDataset(Dataset dataset); Dataset getDataset(); static List<Column> columnNamesForMetaTable(JsonNode config); static List<Column> columnNamesForSchema(JsonNode tableSchema); static Column createStringColumn(JsonNode columnName); static final String AUTHOR; static final String TITLE; static final String YEAR; static final String JOURNAL; static final String VOLUME; static final String NUMBER; static final String PAGES; static final String LONGITUDE; static final String LATITUDE; static final String EVENT_DATE; }