Skip to content

Methods_T_CodeJam_Option_1

andrewvk edited this page Mar 22, 2016 · 5 revisions

Option(T) Methods

[This is preliminary documentation and is subject to change.]

The Option(T) generic type exposes the following members.

Methods

 

Name Description
Public method Equals Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method GetHashCode Returns the hash code for this instance. (Inherited from ValueType.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method ToString Returns the fully qualified type name of this instance. (Inherited from ValueType.)
  Back to Top

Extension Methods

 

Name Description
Public Extension Method GetValueOrDefault(T) Returns value of option, or defaultValue if option hasn't it. (Defined by OptionExtensions.)
Public Extension Method Map(T, TResult) Converts option value to another option with selectFunc. (Defined by OptionExtensions.)
Public Extension Method Match(T)(Action(Option(T)), Action) Overloaded.
Calls someAction if option has value, and noneAction otherwise. (Defined by OptionExtensions.)
Public Extension Method Match(T, TResult)(Func(Option(T), TResult), Func(TResult)) Overloaded.
Calls someFunc if option has value, and noneFunc otherwise. (Defined by OptionExtensions.)
  Back to Top

See Also

Reference

Option(T) Structure
CodeJam Namespace

Clone this wiki locally