package codeu.chat.common;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;

import codeu.chat.util.Serializer;
import codeu.chat.util.Serializers;
import codeu.chat.util.Time;
import codeu.chat.util.Uuid;

public final class Interests {

  public static final Serializer<Interests> SERIALIZER = new Serializer<Interests>() {

    @Override
    public void write(OutputStream out, Interests value) throws IOException {

      Serializers.collection(Interests.SERIALIZER).write(out, value.interests);
      Time.SERIALIZER.write(out, value.lastStatusUpdate);
      Time.SERIALIZER.write(out, value.creation);

    }

    @Override
    public Interests read(InputStream in) throws IOException {

      return new Interests(
          Serializers.collection(Interests.SERIALIZER).read(in),
          Time.SERIALIZER.read(in),
          Time.SERIALIZER.read(in)
      );

    }
  };

  public final Collection<Interests> interests;
  public final Time lastStatusUpdate;
  public final Time creation;

  public Interests(Collection<Interests> interests, Time lastStatusUpdate, Time creation) {

    this.interests = interests;
    this.lastStatusUpdate = lastStatusUpdate;
    this.creation = creation;

  }
}
@@ -504,33 +504,28 @@
 .collection(
-Interests
+Uuid
 .SERIALIZER)
@@ -809,25 +809,20 @@
 lection(
-Interests
+Uuid
 .SERIALI
@@ -951,33 +951,28 @@
  Collection%3C
-Interests
+Uuid
 %3E interests;
@@ -1071,25 +1071,20 @@
 lection%3C
-Interests
+Uuid
 %3E intere

Fix bug in Interests.java