1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.api
21 
22 import java.util.concurrent.TimeUnit
23 
24 import akka.http.scaladsl.server.{Directive0, Directive1}
25 
26 import scala.concurrent.duration.FiniteDuration
27 
28 object Predef {
29 
30   implicit class RichScalaDuration(val self: java.time.Duration) extends AnyVal {
31     def toScala: FiniteDuration = {
32       FiniteDuration(self.toNanos, TimeUnit.NANOSECONDS)
33     }
34   }
35 
36   implicit class RichDirective0(val self: Directive0) extends AnyVal {
37     def map[B](f: Unit => B): Directive1[B] = {
38       self.tmap(f)
39     }
40 
41     def flatMap[B](f: Unit => Directive1[B]): Directive1[B] = {
42       self.tflatMap(f)
43     }
44   }
45 }
Line Stmt Id Pos Tree Symbol Tests Code
32 38375 1054 - 1104 Apply scala.concurrent.duration.FiniteDuration.apply scala.concurrent.duration.FiniteDuration.apply(RichScalaDuration.this.self.toNanos(), NANOSECONDS)
32 34249 1069 - 1081 Apply java.time.Duration.toNanos RichScalaDuration.this.self.toNanos()
32 47252 1083 - 1103 Literal <nosymbol> NANOSECONDS
38 30820 1250 - 1250 TypeApply akka.http.scaladsl.server.util.LowerPriorityTupler.forAnyRef util.this.Tupler.forAnyRef[B]
38 43880 1241 - 1253 ApplyToImplicitArgs akka.http.scaladsl.server.Directive.tmap RichDirective0.this.self.tmap[B](f)(util.this.Tupler.forAnyRef[B])
42 31867 1331 - 1347 ApplyToImplicitArgs akka.http.scaladsl.server.Directive.tflatMap org.make.api.user.adminuserapitest RichDirective0.this.self.tflatMap[(B,)](f)(util.this.Tuple.forTuple1[B])
42 40776 1344 - 1344 TypeApply akka.http.scaladsl.server.util.Tuple.forTuple1 org.make.api.user.adminuserapitest util.this.Tuple.forTuple1[B]