class PrettyFunction0[A] extends () ⇒ A
A nullary (zero-parameter) "function" that is a bit friendlier to testing.
This is a variant of () => A -- that is, a function that takes no parameters
and returns an A. In practice, that isn't quite true: where () => A is
lazy (it is not evaluated until you call it), this one is strict (you pass the
result in as a parameter).
In exchange, this is more usable and reproducible for test environments. Its
hashCode and equals are based on those of the passed-in value (so they are
consistent and reproducible), and its toString nicely displays the result
that will always be returned.
- A
the type that is returned by this function
- Source
- PrettyFunction0.scala
- Alphabetic
- By Inheritance
- PrettyFunction0
- Function0
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
PrettyFunction0(result: A)
- result
the value that will be returned by this function
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(): A
- Definition Classes
- PrettyFunction0 → Function0
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(o: Any): Boolean
- Definition Classes
- PrettyFunction0 → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- PrettyFunction0 → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- PrettyFunction0 → Function0 → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )