001package edu.pdx.cs410J.airline;
002
003import edu.pdx.cs410J.AirlineDumper;
004
005import java.io.PrintWriter;
006import java.io.Writer;
007
008/**
009 * A skeletal implementation of the <code>TextDumper</code> class for Project 2.
010 */
011public class TextDumper implements AirlineDumper<Airline> {
012  private final Writer writer;
013
014  public TextDumper(Writer writer) {
015    this.writer = writer;
016  }
017
018  @Override
019  public void dump(Airline airline) {
020    try (
021      PrintWriter pw = new PrintWriter(this.writer)
022      ) {
023      pw.println(airline.getName());
024
025      pw.flush();
026    }
027  }
028}