Skip to content

T_CodeJam_Option

andrewvk edited this page Apr 20, 2016 · 6 revisions

Option Class

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

Methods to work with Option(T)

Inheritance Hierarchy

System.Object
  CodeJam.Option
Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public static class Option

VB

<ExtensionAttribute>
Public NotInheritable Class Option

F#

[<AbstractClassAttribute>]
[<SealedAttribute>]
[<ExtensionAttribute>]
type Option =  class end

The Option type exposes the following members.

Methods

 

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

See Also

Reference

CodeJam Namespace

Clone this wiki locally