Optional
Object Hierarchy:
Gpseq.Optional
Gpseq.Optional
Gpseq.Optional
GLib.Object
GLib.Object
GLib.Object->Gpseq.Optional
Description:
public class Optional <G > : Object
A container object which may or may not contain a value.
Content:
Properties:
Creation methods:
Methods:
public Optional <G > filter (Predicate <G > pred)
If a value is present and matches the given predicate, returns an
optional containing the value, otherwise returns an empty optional.
public void if_present (Func <G > consumer)
If a value is present, performs the given consumer function with the
value.
public Optional <A > map <A > (MapFunc <Optional <A >,G > mapper)
If a value is present, performs the mapper function with the value,
and returns the result. Otherwise returns an empty optional.
public G or_else (G other)
If a value is present, returns the value, otherwise returns the given
other.
public G or_else_fail ()
If a value is present, returns the value, otherwise fails with
GLib.error .
public G or_else_get (SupplyFunc <G > supplier)
If a value is present, returns the value, otherwise returns the result
produced by the supply function.
public G or_else_throw (SupplyFunc <Error >? error_supplier = null ) throws Error
If a value is present, returns the value, otherwise throws an error
produced by the supply function -- or an OptionalError.NOT_PRESENT
error if the function is not specified.
public string to_string ()
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref