@Test public void testGetRowWithHost() { Row expected = Row.of( COL_FILENAME, "host", COL_PARSE_STATUS, "EMPTY", COL_NODES, ImmutableList.of(new Node("h1"))); Row row = FileParseStatusAnswerer.getRow("host", ParseStatus.EMPTY, ImmutableList.of("h1")); assertThat(row, equalTo(expected)); }
@Nonnull @VisibleForTesting static Row getRow( String filename, ParseStatus status, @Nullable Collection<String> hostsProduced) { Row.TypedRowBuilder builder = Row.builder(TABLE_METADATA.toColumnMap()); builder.put(COL_FILENAME, filename); builder.put(COL_PARSE_STATUS, status.toString()); ImmutableList.Builder<Node> nodesProduced = ImmutableList.builder(); for (String hostname : firstNonNull(hostsProduced, Collections.<String>emptyList())) { nodesProduced.add(new Node(hostname)); } builder.put(COL_NODES, nodesProduced.build()); return builder.build(); }
FileParseStatusAnswerer extends Answerer { @Nonnull @VisibleForTesting static Row getRow( String filename, ParseStatus status, @Nullable Collection<String> hostsProduced) { Row.TypedRowBuilder builder = Row.builder(TABLE_METADATA.toColumnMap()); builder.put(COL_FILENAME, filename); builder.put(COL_PARSE_STATUS, status.toString()); ImmutableList.Builder<Node> nodesProduced = ImmutableList.builder(); for (String hostname : firstNonNull(hostsProduced, Collections.<String>emptyList())) { nodesProduced.add(new Node(hostname)); } builder.put(COL_NODES, nodesProduced.build()); return builder.build(); } }
FileParseStatusAnswerer extends Answerer { @Nonnull @VisibleForTesting static Row getRow( String filename, ParseStatus status, @Nullable Collection<String> hostsProduced) { Row.TypedRowBuilder builder = Row.builder(TABLE_METADATA.toColumnMap()); builder.put(COL_FILENAME, filename); builder.put(COL_PARSE_STATUS, status.toString()); ImmutableList.Builder<Node> nodesProduced = ImmutableList.builder(); for (String hostname : firstNonNull(hostsProduced, Collections.<String>emptyList())) { nodesProduced.add(new Node(hostname)); } builder.put(COL_NODES, nodesProduced.build()); return builder.build(); } FileParseStatusAnswerer(FileParseStatusQuestion question, IBatfish batfish); }
FileParseStatusAnswerer extends Answerer { @Nonnull @VisibleForTesting static Row getRow( String filename, ParseStatus status, @Nullable Collection<String> hostsProduced) { Row.TypedRowBuilder builder = Row.builder(TABLE_METADATA.toColumnMap()); builder.put(COL_FILENAME, filename); builder.put(COL_PARSE_STATUS, status.toString()); ImmutableList.Builder<Node> nodesProduced = ImmutableList.builder(); for (String hostname : firstNonNull(hostsProduced, Collections.<String>emptyList())) { nodesProduced.add(new Node(hostname)); } builder.put(COL_NODES, nodesProduced.build()); return builder.build(); } FileParseStatusAnswerer(FileParseStatusQuestion question, IBatfish batfish); @Override TableAnswerElement answer(NetworkSnapshot snapshot); }
FileParseStatusAnswerer extends Answerer { @Nonnull @VisibleForTesting static Row getRow( String filename, ParseStatus status, @Nullable Collection<String> hostsProduced) { Row.TypedRowBuilder builder = Row.builder(TABLE_METADATA.toColumnMap()); builder.put(COL_FILENAME, filename); builder.put(COL_PARSE_STATUS, status.toString()); ImmutableList.Builder<Node> nodesProduced = ImmutableList.builder(); for (String hostname : firstNonNull(hostsProduced, Collections.<String>emptyList())) { nodesProduced.add(new Node(hostname)); } builder.put(COL_NODES, nodesProduced.build()); return builder.build(); } FileParseStatusAnswerer(FileParseStatusQuestion question, IBatfish batfish); @Override TableAnswerElement answer(NetworkSnapshot snapshot);  }