@Test public void testCreateMetadata() { BgpSessionCompatibilityQuestion q = new BgpSessionCompatibilityQuestion(); TableMetadata metadata = createMetadata(q); assertThat( metadata.getTextDesc(), equalTo( "On ${Node} session ${VRF}:${Remote_IP} has configured status ${Configured_Status}.")); assertThat(metadata.getColumnMetadata(), equalTo(COLUMN_METADATA)); q.setDisplayHints(new DisplayHints(null, null, "display hints")); metadata = createMetadata(q); assertThat(metadata.getTextDesc(), equalTo("display hints")); assertThat(metadata.getColumnMetadata(), equalTo(COLUMN_METADATA)); }
public static TableMetadata createMetadata(Question question) { String textDesc = String.format( "On ${%s} session ${%s}:${%s} has configured status ${%s}.", COL_NODE, COL_VRF, COL_REMOTE_IP, COL_CONFIGURED_STATUS); DisplayHints dhints = question.getDisplayHints(); if (dhints != null && dhints.getTextDesc() != null) { textDesc = dhints.getTextDesc(); } return new TableMetadata(COLUMN_METADATA, textDesc); }
BgpSessionCompatibilityAnswerer extends Answerer { public static TableMetadata createMetadata(Question question) { String textDesc = String.format( "On ${%s} session ${%s}:${%s} has configured status ${%s}.", COL_NODE, COL_VRF, COL_REMOTE_IP, COL_CONFIGURED_STATUS); DisplayHints dhints = question.getDisplayHints(); if (dhints != null && dhints.getTextDesc() != null) { textDesc = dhints.getTextDesc(); } return new TableMetadata(COLUMN_METADATA, textDesc); } }
BgpSessionCompatibilityAnswerer extends Answerer { public static TableMetadata createMetadata(Question question) { String textDesc = String.format( "On ${%s} session ${%s}:${%s} has configured status ${%s}.", COL_NODE, COL_VRF, COL_REMOTE_IP, COL_CONFIGURED_STATUS); DisplayHints dhints = question.getDisplayHints(); if (dhints != null && dhints.getTextDesc() != null) { textDesc = dhints.getTextDesc(); } return new TableMetadata(COLUMN_METADATA, textDesc); } BgpSessionCompatibilityAnswerer(Question question, IBatfish batfish); }
BgpSessionCompatibilityAnswerer extends Answerer { public static TableMetadata createMetadata(Question question) { String textDesc = String.format( "On ${%s} session ${%s}:${%s} has configured status ${%s}.", COL_NODE, COL_VRF, COL_REMOTE_IP, COL_CONFIGURED_STATUS); DisplayHints dhints = question.getDisplayHints(); if (dhints != null && dhints.getTextDesc() != null) { textDesc = dhints.getTextDesc(); } return new TableMetadata(COLUMN_METADATA, textDesc); } BgpSessionCompatibilityAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); static TableMetadata createMetadata(Question question); }
BgpSessionCompatibilityAnswerer extends Answerer { public static TableMetadata createMetadata(Question question) { String textDesc = String.format( "On ${%s} session ${%s}:${%s} has configured status ${%s}.", COL_NODE, COL_VRF, COL_REMOTE_IP, COL_CONFIGURED_STATUS); DisplayHints dhints = question.getDisplayHints(); if (dhints != null && dhints.getTextDesc() != null) { textDesc = dhints.getTextDesc(); } return new TableMetadata(COLUMN_METADATA, textDesc); } BgpSessionCompatibilityAnswerer(Question question, IBatfish batfish); @Override AnswerElement answer(NetworkSnapshot snapshot); static TableMetadata createMetadata(Question question); static final String COL_CONFIGURED_STATUS; }