@Test public void getValue() { Row row = initRowThree(); List<ColumnMetadata> metadataNoValues = initMetadataThree(false, false, false, false, false, false); List<ColumnMetadata> metadataOneValue = initMetadataThree(false, false, false, false, true, false); List<ColumnMetadata> metadataTwoValues = initMetadataThree(true, false, true, true, false, true); assertThat(row.getValue(metadataNoValues), equalTo(ImmutableList.of())); assertThat(row.getValue(metadataOneValue), equalTo(ImmutableList.of("value2"))); assertThat(row.getValue(metadataTwoValues), equalTo(ImmutableList.of("value1", "value3"))); }
public List<Object> getValue(List<ColumnMetadata> metadata) { List<Object> valueList = new LinkedList<>(); for (ColumnMetadata column : metadata) { if (column.getIsValue()) { valueList.add(get(column.getName(), column.getSchema())); } } return valueList; }
Row implements Comparable<Row>, Serializable { public List<Object> getValue(List<ColumnMetadata> metadata) { List<Object> valueList = new LinkedList<>(); for (ColumnMetadata column : metadata) { if (column.getIsValue()) { valueList.add(get(column.getName(), column.getSchema())); } } return valueList; } }
Row implements Comparable<Row>, Serializable { public List<Object> getValue(List<ColumnMetadata> metadata) { List<Object> valueList = new LinkedList<>(); for (ColumnMetadata column : metadata) { if (column.getIsValue()) { valueList.add(get(column.getName(), column.getSchema())); } } return valueList; } @JsonCreator private  Row(ObjectNode data); }
Row implements Comparable<Row>, Serializable { public List<Object> getValue(List<ColumnMetadata> metadata) { List<Object> valueList = new LinkedList<>(); for (ColumnMetadata column : metadata) { if (column.getIsValue()) { valueList.add(get(column.getName(), column.getSchema())); } } return valueList; } @JsonCreator private  Row(ObjectNode data); static Row of(Object... objects); static Row of(Map<String, ColumnMetadata> columns, Object... objects); static UntypedRowBuilder builder(); static TypedRowBuilder builder(Map<String, ColumnMetadata> columns); @Override int compareTo(Row o); @Override boolean equals(Object o); JsonNode get(String columnName); Object get(String columnName, Schema columnSchema); T get(String columnName, TypeReference<T> typeReference); Boolean getBoolean(String column); Set<String> getColumnNames(); Double getDouble(String column); FileLines getFileLines(String column); Flow getFlow(String column); Integer getInteger(String column); List<Object> getKey(List<ColumnMetadata> metadata); NodeInterfacePair getInterface(String column); Ip getIp(String column); Issue getIssue(String column); @Nullable Long getLong(String column); Node getNode(String column); Object getObject(String column); Prefix getPrefix(String column); SelfDescribingObject getSelfDescribing(String column); String getString(String column); @Nullable Trace getTrace(String column); List<Object> getValue(List<ColumnMetadata> metadata); @Override int hashCode(); boolean isCovered(ObjectNode exclusion); static String missingColumnErrorMessage(String columnName, Set<String> columns); @Override String toString(); boolean hasNonNull(String column); }
Row implements Comparable<Row>, Serializable { public List<Object> getValue(List<ColumnMetadata> metadata) { List<Object> valueList = new LinkedList<>(); for (ColumnMetadata column : metadata) { if (column.getIsValue()) { valueList.add(get(column.getName(), column.getSchema())); } } return valueList; } @JsonCreator private  Row(ObjectNode data); static Row of(Object... objects); static Row of(Map<String, ColumnMetadata> columns, Object... objects); static UntypedRowBuilder builder(); static TypedRowBuilder builder(Map<String, ColumnMetadata> columns); @Override int compareTo(Row o); @Override boolean equals(Object o); JsonNode get(String columnName); Object get(String columnName, Schema columnSchema); T get(String columnName, TypeReference<T> typeReference); Boolean getBoolean(String column); Set<String> getColumnNames(); Double getDouble(String column); FileLines getFileLines(String column); Flow getFlow(String column); Integer getInteger(String column); List<Object> getKey(List<ColumnMetadata> metadata); NodeInterfacePair getInterface(String column); Ip getIp(String column); Issue getIssue(String column); @Nullable Long getLong(String column); Node getNode(String column); Object getObject(String column); Prefix getPrefix(String column); SelfDescribingObject getSelfDescribing(String column); String getString(String column); @Nullable Trace getTrace(String column); List<Object> getValue(List<ColumnMetadata> metadata); @Override int hashCode(); boolean isCovered(ObjectNode exclusion); static String missingColumnErrorMessage(String columnName, Set<String> columns); @Override String toString(); boolean hasNonNull(String column);  }