Interface Option<T>

Type Parameters:
T - the wrapped value
All Superinterfaces:
Applicable<Option<?>,T>, Bindable<Option<?>,T>, Kind<Option<?>,T>, Mappable<Option<?>,T>, OptionOf<T>
All Known Implementing Classes:
Option.None, Option.Some

public sealed interface Option<T> extends OptionOf<T>, Bindable<Option<?>,T>, Applicable<Option<?>,T> permits Option.Some<T>, Option.None<T>

This type represents the presence or absence of a value, similar to Optional

There are two possible values:

  • Option.none(): that represent the absence of a value
  • Option.some(value): that represent the presence of a value

Note: it's serializable