doc / ch.tutteli.atrium.creating / MaybeSubject

MaybeSubject

sealed class MaybeSubject<out T> (source)

Represents a BaseAssertionPlant.subject 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 BaseAssertionPlant.subject.

Present

data class Present<T> : MaybeSubject<T>

Represents a present BaseAssertionPlant.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 BaseAssertionPlant.subject.

Present

data class Present<T> : MaybeSubject<T>

Represents a present BaseAssertionPlant.subject.