doc / ch.tutteli.atrium.creating / MaybeSubject

MaybeSubject

sealed class MaybeSubject<out T>
Deprecated: Use something like ch.tutteli.atrium.core.Option instead; will be removed with 1.0.0

Represents a subject of an assertion which might be Present or Absent.

It provides a method get where one can get the underlying subject (if Present).

Types

Absent

object Absent : MaybeSubject<Nothing>

Represents an absent subject.

Present

data class Present<T> : MaybeSubject<T>

Represents a present subject.

Functions

get

abstract fun get(): T

Returns the underlying subject or throws a PlantHasNoSubjectException if it is Absent.

Companion Object Functions

invoke

operator fun <T : Any> invoke(subject: T?): MaybeSubject<T>

Inheritors

Absent

object Absent : MaybeSubject<Nothing>

Represents an absent subject.

Present

data class Present<T> : MaybeSubject<T>

Represents a present subject.