util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeapSort

func HeapSort(arr []interface{}, less func(a, b interface{}) bool) []interface{}

func MergeSort

func MergeSort(data []interface{}, less func(prev, cur interface{}) bool) []interface{}

Types

type Optional

type Optional struct {
	// contains filtered or unexported fields
}

func Of

func Of(data interface{}) *Optional

func OfEmpty

func OfEmpty() *Optional

func OfNillable

func OfNillable(data interface{}) *Optional

func (*Optional) Filter

func (opt *Optional) Filter(filter func(data interface{}) bool) *Optional

func (*Optional) FlatMap

func (opt *Optional) FlatMap(mapper func(data interface{}) *Optional) *Optional

func (*Optional) Get

func (opt *Optional) Get() interface{}

func (*Optional) IfPresent

func (opt *Optional) IfPresent(consumer func(data interface{}))

func (*Optional) IsPresent

func (opt *Optional) IsPresent() bool

func (*Optional) Map

func (opt *Optional) Map(mapper func(data interface{}) interface{}) *Optional

func (*Optional) OrElse

func (opt *Optional) OrElse(or interface{}) interface{}

func (*Optional) OrElseError

func (opt *Optional) OrElseError(err func() error) (interface{}, error)

func (*Optional) OrElseGet

func (opt *Optional) OrElseGet(getter func() interface{}) interface{}

func (*Optional) String

func (opt *Optional) String() string

Jump to

Keyboard shortcuts

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