class RoutesAnswerer extends Answerer {

  @Override
  public AnswerElement answer(NetworkSnapshot snapshot) {
    RoutesQuestion question = (RoutesQuestion) _question;
    TableAnswerElement answer = new TableAnswerElement(getTableMetadata(question.getRib()));

    DataPlane dp = _batfish.loadDataPlane(snapshot);
    Set<String> matchingNodes =
        question.getNodeSpecifier().resolve(_batfish.specifierContext(snapshot));
    Prefix network = question.getNetwork();
    RoutingProtocolSpecifier protocolSpec = question.getRoutingProtocolSpecifier();
    String vrfRegex = question.getVrfs();
    Map<Ip, Set<String>> ipOwners =
        computeIpNodeOwners(_batfish.loadConfigurations(snapshot), true);

    Multiset<Row> rows;

    switch (question.getRib()) {
      case BGP:
        rows =
            getBgpRibRoutes(
                dp.getBgpRoutes(), RibProtocol.BGP, matchingNodes, network, protocolSpec, vrfRegex);
        break;
      case EVPN:
        rows =
            getEvpnRoutes(
                dp.getEvpnRoutes(),
                RibProtocol.EVPN,
                matchingNodes,
                network,
                protocolSpec,
                vrfRegex);
        break;
      case MAIN:
      default:
        rows =
            getMainRibRoutes(
                dp.getRibs(), matchingNodes, network, protocolSpec, vrfRegex, ipOwners);
    }

    answer.postProcessAnswer(_question, rows);
    return answer;
  }

    RoutesAnswerer(Question question, IBatfish batfish);

}