@@ -0,0 +1,2772 @@
+package org.batfish.question;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.batfish.common.Answerer;%0Aimport org.batfish.common.plugin.IBatfish;%0Aimport org.batfish.datamodel.answers.AnswerElement;%0Aimport org.batfish.datamodel.questions.Question;%0A%0Aimport com.fasterxml.jackson.annotation.JsonProperty;%0A%0Apublic class CompositeQuestionPlugin extends QuestionPlugin %7B%0A%0A   public static class CompositeAnswerElement implements AnswerElement %7B%0A%0A      private static final String ANSWERS_VAR = %22answers%22;%0A%0A      private List%3CAnswerElement%3E _answers;%0A%0A      public CompositeAnswerElement() %7B%0A         _answers = new ArrayList%3C%3E();%0A      %7D%0A%0A      @JsonProperty(ANSWERS_VAR)%0A      public List%3CAnswerElement%3E getAnswers() %7B%0A         return _answers;%0A      %7D%0A%0A      @JsonProperty(ANSWERS_VAR)%0A      public void setAnswers(List%3CAnswerElement%3E answers) %7B%0A         _answers = answers;%0A      %7D%0A%0A   %7D%0A%0A   public static class CompositeAnswerer extends Answerer %7B%0A%0A      public CompositeAnswerer(Question question, IBatfish batfish) %7B%0A         super(question, batfish);%0A      %7D%0A%0A      @Override%0A      public CompositeAnswerElement answer() %7B%0A         CompositeQuestion question = (CompositeQuestion) _question;%0A         CompositeAnswerElement answerElement = new CompositeAnswerElement();%0A         for (Question innerQuestion : question._questions) %7B%0A            String innerQuestionName = innerQuestion.getName();%0A            Answerer innerAnswerer = _batfish.getAnswererCreators()%0A                  .get(innerQuestionName).apply(innerQuestion, _batfish);%0A            AnswerElement innerAnswer = innerAnswerer.answer();%0A            answerElement._answers.add(innerAnswer);%0A         %7D%0A         return answerElement;%0A      %7D%0A   %7D%0A%0A   public static class CompositeQuestion extends Question %7B%0A%0A      private static final String QUESTIONS_VAR = %22questions%22;%0A%0A      private List%3CQuestion%3E _questions;%0A%0A      public CompositeQuestion() %7B%0A         _questions = new ArrayList%3C%3E();%0A      %7D%0A%0A      @Override%0A      public boolean getDataPlane() %7B%0A         return false;%0A      %7D%0A%0A      @Override%0A      public String getName() %7B%0A         return %22composite%22;%0A      %7D%0A%0A      @JsonProperty(QUESTIONS_VAR)%0A      public List%3CQuestion%3E getQuestions() %7B%0A         return _questions;%0A      %7D%0A%0A      @Override%0A      public boolean getTraffic() %7B%0A         return false;%0A      %7D%0A%0A      @JsonProperty(QUESTIONS_VAR)%0A      public void setQuestions(List%3CQuestion%3E questions) %7B%0A         _questions = questions;%0A      %7D%0A%0A   %7D%0A%0A   @Override%0A   protected CompositeAnswerer createAnswerer(Question question,%0A         IBatfish batfish) %7B%0A      return new CompositeAnswerer(question, batfish);%0A   %7D%0A%0A   @Override%0A   protected CompositeQuestion createQuestion() %7B%0A      return new CompositeQuestion();%0A   %7D%0A%0A%7D%0A

add Composite base question