@Test public void testMetaData() { List<ColumnMetadata> metas = OspfAreaConfigurationAnswerer.createTableMetadata().getColumnMetadata(); assertThat( metas.stream().map(ColumnMetadata::getName).collect(ImmutableList.toImmutableList()), equalTo( ImmutableList.builder() .add(OspfAreaConfigurationAnswerer.COL_NODE) .add(OspfAreaConfigurationAnswerer.COL_VRF) .add(OspfAreaConfigurationAnswerer.COL_PROCESS_ID) .add(OspfAreaConfigurationAnswerer.COL_AREA) .add(OspfAreaConfigurationAnswerer.COL_AREA_TYPE) .add(OspfAreaConfigurationAnswerer.COL_ACTIVE_INTERFACES) .add(OspfAreaConfigurationAnswerer.COL_PASSIVE_INTERFACES) .build())); }
@VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add(new ColumnMetadata(COL_NODE, Schema.NODE, "Node", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_PROCESS_ID, Schema.STRING, "Process ID", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.STRING, "Area number", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA_TYPE, Schema.STRING, "Area type", false, true)); columnBuilder.add( new ColumnMetadata( COL_ACTIVE_INTERFACES, Schema.set(Schema.STRING), "Names of active interfaces", false, true)); columnBuilder.add( new ColumnMetadata( COL_PASSIVE_INTERFACES, Schema.set(Schema.STRING), "Names of passive interfaces", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF information areas"); }
OspfAreaConfigurationAnswerer extends Answerer { @VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add(new ColumnMetadata(COL_NODE, Schema.NODE, "Node", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_PROCESS_ID, Schema.STRING, "Process ID", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.STRING, "Area number", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA_TYPE, Schema.STRING, "Area type", false, true)); columnBuilder.add( new ColumnMetadata( COL_ACTIVE_INTERFACES, Schema.set(Schema.STRING), "Names of active interfaces", false, true)); columnBuilder.add( new ColumnMetadata( COL_PASSIVE_INTERFACES, Schema.set(Schema.STRING), "Names of passive interfaces", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF information areas"); } }
OspfAreaConfigurationAnswerer extends Answerer { @VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add(new ColumnMetadata(COL_NODE, Schema.NODE, "Node", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_PROCESS_ID, Schema.STRING, "Process ID", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.STRING, "Area number", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA_TYPE, Schema.STRING, "Area type", false, true)); columnBuilder.add( new ColumnMetadata( COL_ACTIVE_INTERFACES, Schema.set(Schema.STRING), "Names of active interfaces", false, true)); columnBuilder.add( new ColumnMetadata( COL_PASSIVE_INTERFACES, Schema.set(Schema.STRING), "Names of passive interfaces", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF information areas"); } OspfAreaConfigurationAnswerer(Question question, IBatfish batfish); }
OspfAreaConfigurationAnswerer extends Answerer { @VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add(new ColumnMetadata(COL_NODE, Schema.NODE, "Node", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_PROCESS_ID, Schema.STRING, "Process ID", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.STRING, "Area number", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA_TYPE, Schema.STRING, "Area type", false, true)); columnBuilder.add( new ColumnMetadata( COL_ACTIVE_INTERFACES, Schema.set(Schema.STRING), "Names of active interfaces", false, true)); columnBuilder.add( new ColumnMetadata( COL_PASSIVE_INTERFACES, Schema.set(Schema.STRING), "Names of passive interfaces", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF information areas"); } OspfAreaConfigurationAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); }
OspfAreaConfigurationAnswerer extends Answerer { @VisibleForTesting static TableMetadata createTableMetadata() { ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder(); columnBuilder.add(new ColumnMetadata(COL_NODE, Schema.NODE, "Node", true, false)); columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false)); columnBuilder.add(new ColumnMetadata(COL_PROCESS_ID, Schema.STRING, "Process ID", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.STRING, "Area number", true, false)); columnBuilder.add(new ColumnMetadata(COL_AREA_TYPE, Schema.STRING, "Area type", false, true)); columnBuilder.add( new ColumnMetadata( COL_ACTIVE_INTERFACES, Schema.set(Schema.STRING), "Names of active interfaces", false, true)); columnBuilder.add( new ColumnMetadata( COL_PASSIVE_INTERFACES, Schema.set(Schema.STRING), "Names of passive interfaces", false, true)); return new TableMetadata(columnBuilder.build(), "Display OSPF information areas"); } OspfAreaConfigurationAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot);  }