-
-
Notifications
You must be signed in to change notification settings - Fork 3
NullableProperty
class NullableProperty<T :
Any
> :
ForgeryProperty
<T?>
This class implements a ReadOnlyProperty, forging a random object with a given probability of being null.
delegate
- the delegate that will forge a non-null random object of the desired type
probability
- the probability the instance will be null (default 0.5f)
NullableProperty(delegate:
ForgeryProperty
<T>, probability:
Float
= Forge.HALF_PROBABILITY)
This class implements a ReadOnlyProperty, forging a random object with a given probability of being null.
delegate
- the delegate that will forge a non-null random object of the desired type
probability
- the probability the instance will be null (default 0.5f)
fun getForgery(forge:
Forge
): T?
Inheritdoc
fun <T :
Any
> nullableForgery(delegate:
ForgeryProperty
<T>, probability:
Float
= Forge.HALF_PROBABILITY):
ReadOnlyProperty
<
ForgeryAware
, T?>
Creates a ReadOnlyProperty that will forge a random object with a given probability of being null.
delegate
- the delegate that will forge a non-null random object of the desired type
probability
- the probability the instance will be null (default 0.5f)fun <T :
Any
> nullableForgery(probability:
Float
= Forge.HALF_PROBABILITY, lambda:
Forge
.() -> T):
ReadOnlyProperty
<
ForgeryAware
, T?>
Creates a ReadOnlyProperty that will forge a random object with a given probability of being null.
lambda
- the lambda that will forge a non-null random object of the desired type
probability
- the probability the instance will be null (default 0.5f)
Xavier F. Gouchet – @xgouchet
Distributed under the MIT license. See LICENSE.md for more information.
https://github.com/xgouchet/Elymr
- Home
- Getting Started
- Core Module
- Integrations
- Reference (core)
- Reference (junit4)
- Reference (junit5)
- Reference (spek)