aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala')
-rw-r--r--src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala b/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala
index 183ad9a..8ba184f 100644
--- a/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala
+++ b/src/main/scala/xyz/driver/core/rest/directives/PathMatchers.scala
@@ -27,6 +27,12 @@ trait PathMatchers {
}
}
+ def UuidIdInPath[T]: PathMatcher1[UuidId[T]] =
+ AkkaPathMatchers.JavaUUID.map((id: UUID) => UuidId[T](id))
+
+ def NumericIdInPath[T]: PathMatcher1[NumericId[T]] =
+ AkkaPathMatchers.LongNumber.map((id: Long) => NumericId[T](id))
+
def NameInPath[T]: PathMatcher1[Name[T]] = new PathMatcher1[Name[T]] {
def apply(path: Path) = path match {
case Path.Segment(segment, tail) => Matched(tail, Tuple1(Name[T](segment)))