Stricter precondition to create a DSLTimeFrame object
authorGeorgios Gousios <gousiosg@gmail.com>
Wed, 21 Dec 2011 12:08:55 +0000 (14:08 +0200)
committerGeorgios Gousios <gousiosg@gmail.com>
Wed, 21 Dec 2011 12:10:11 +0000 (14:10 +0200)
src/main/scala/gr/grnet/aquarium/logic/accounting/dsl/DSLTimeFrame.scala

index ee54e32..1fbf1dd 100644 (file)
@@ -46,4 +46,10 @@ case class DSLTimeFrame (
   from: Date,
   to: Option[Date],
   repeat: List[DSLTimeFrameRepeat]
-)
+) {
+
+  to match {
+    case Some(x) => assert(x.after(from))
+    case None =>
+  }
+}