class GradleBuildOutputParser implements BuildOutputParser {

  @Override
  public boolean parse(@NotNull String line,
                       @NotNull BuildOutputInstantReader reader,
                       @NotNull Consumer<? super BuildEvent> messageConsumer) {
    String currentLine = line.trim();
    if (currentLine.startsWith(STDOUT_ERROR_TAG)) {
      processMessage(currentLine, reader.getParentEventId(), messageConsumer);
      return true;
    }

    // consume the line without producing a message, and remove it from the map
    if (futureOutputMap.getOrDefault(reader.getParentEventId(), Collections.emptySet()).contains(currentLine)) {
      futureOutputMap.get(reader.getParentEventId()).remove(currentLine);
      return true;
    }

    return false;
  }

  public  GradleBuildOutputParser();

}