shapeless icon indicating copy to clipboard operation
shapeless copied to clipboard

enum value should be serializable and should also keep referential integrity

Open JurajBurian opened this issue 9 years ago • 0 comments

// let say that "enum" WeekDay with value Mon is defined
// then this test should be ok:
  val out = new ByteArrayOutputStream()
  new ObjectOutputStream(out).writeObject(Mon);
  out.close();
  val monday = new ObjectInputStream(new ByteArrayInputStream(out.toByteArray)).readObject()
  assert(monday == Mon)

JurajBurian avatar Jun 30 '15 15:06 JurajBurian