Documentation ¶
Index ¶
- type Optional
- func (op *Optional[T]) Equals(value T) bool
- func (op *Optional[T]) Get() T
- func (op *Optional[T]) IfPresent(f func(T))
- func (op *Optional[T]) IsEmpty() bool
- func (op *Optional[T]) IsPresent() bool
- func (op *Optional[T]) OrElse(other T) T
- func (op *Optional[T]) OrElseThrow(msg string) T
- func (op *Optional[T]) String() string
- type OptionalInt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Optional ¶
OptionalEmpty() Optional --- return an empty Optional instance OptionalOf(value) Optional --- return an Optional with the specified present non-null value Optional.ToString() string --- return a non-empty string representation of this optional suitable for debugging Optional.Get() interface{} --- If a value is present in this Optional, returns the value Optional.IsPresent() bool --- Whether there is a value in Optional Optional.Equal(obj interface{}) bool --- Indicates whether some other object is "equal to" this Optional
func OfNullable ¶
func (*Optional[T]) OrElseThrow ¶
type OptionalInt ¶
type OptionalInt struct {
// contains filtered or unexported fields
}
OptionalEmpty() Optional --- return an empty Optional instance OptionalOf(value) Optional --- return an Optional with the specified present non-null value Optional.ToString() string --- return a non-empty string representation of this optional suitable for debugging Optional.Get() interface{} --- If a value is present in this Optional, returns the value Optional.IsPresent() bool --- Whether there is a value in Optional Optional.Equal(obj interface{}) bool --- Indicates whether some other object is "equal to" this Optional
func OptionalIntEmpty ¶
func OptionalIntEmpty() *OptionalInt
How does go implement static method - no static method, use function instead
func OptionalIntof ¶
func OptionalIntof(value int32) *OptionalInt
func (*OptionalInt) Equals ¶
func (op *OptionalInt) Equals(value int32) bool
func (*OptionalInt) Get ¶
func (op *OptionalInt) Get() int32
func (*OptionalInt) IsPresent ¶
func (op *OptionalInt) IsPresent() bool
func (*OptionalInt) OrElse ¶
func (op *OptionalInt) OrElse(other int32) int32
func (*OptionalInt) String ¶
func (op *OptionalInt) String() string