Documentation ¶
Index ¶
- type Optional
- func (op Optional[T]) Get() (T, error)
- func (op Optional[T]) GetPointer() (*T, error)
- func (op Optional[T]) IfPresent(doSomething func(t T))
- func (op Optional[T]) IfPresentOrElse(doSomething func(t T), orElse func())
- func (op Optional[T]) IsEmpty() bool
- func (op Optional[T]) IsPresent() bool
- func (op Optional[T]) OrElse(t T) *T
- func (op Optional[T]) OrElseValue(t T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Optional ¶
type Optional[T any] struct { // contains filtered or unexported fields }
func WithPointer ¶
func (Optional[T]) GetPointer ¶
func (Optional[T]) IfPresentOrElse ¶
func (op Optional[T]) IfPresentOrElse(doSomething func(t T), orElse func())
func (Optional[T]) OrElseValue ¶
func (op Optional[T]) OrElseValue(t T) T
Click to show internal directories.
Click to hide internal directories.