001package edu.pdx.cs410J.phonebill;
002
003import edu.pdx.cs410J.PhoneBillDumper;
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 PhoneBillDumper<PhoneBill> {
012  private final Writer writer;
013
014  public TextDumper(Writer writer) {
015    this.writer = writer;
016  }
017
018  @Override
019  public void dump(PhoneBill bill) {
020    try (
021      PrintWriter pw = new PrintWriter(this.writer)
022    ) {
023      pw.println(bill.getCustomer());
024
025      pw.flush();
026    }
027  }
028}