optional

package
v1.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

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 Empty

func Empty[T any]() Optional[T]

func With

func With[T any](t T) Optional[T]

func WithPointer

func WithPointer[T any](t *T) Optional[T]

func (Optional[T]) Get

func (op Optional[T]) Get() (T, error)

func (Optional[T]) GetPointer

func (op Optional[T]) GetPointer() (*T, error)

func (Optional[T]) IfPresent

func (op Optional[T]) IfPresent(doSomething func(t T))

func (Optional[T]) IfPresentOrElse

func (op Optional[T]) IfPresentOrElse(doSomething func(t T), orElse func())

func (Optional[T]) IsEmpty

func (op Optional[T]) IsEmpty() bool

func (Optional[T]) IsPresent

func (op Optional[T]) IsPresent() bool

func (Optional[T]) OrElse

func (op Optional[T]) OrElse(t T) *T

func (Optional[T]) OrElseValue

func (op Optional[T]) OrElseValue(t T) T

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL