Skip to content

T_CodeJam_IOption_1

Andrew Koryavchenko edited this page Jun 17, 2018 · 5 revisions

IOption(T) InterfaceOption(T) and ValueOption(T) common interface.

Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public interface IOption<out T>

VB

Public Interface IOption(Of Out T)

F#

type IOption<'T> =  interface end

Type Parameters

 

T
Type of optional value
  The IOption(T) type exposes the following members.

Properties

 

Name Description
Public property HasValue Gets a value indicating whether the current object has a value.
Public property Value Gets the value of the current object.
  Back to Top

Extension Methods

 

Name Description
Public Extension Method Do(T) Calls someAction if option has value, and noneAction otherwise. (Defined by Option.)
Public Extension Method GetValueOrDefault(T)(T) Overloaded.
Returns value of option, or defaultValue if option hasn't it. (Defined by Option.)
Public Extension Method GetValueOrDefault(T, TResult)(Func(IOption(T), TResult), Func(TResult)) Overloaded.
Calls someSelector if option has value, and noneSelector otherwise. (Defined by Option.)
  Back to Top

See Also

Reference

CodeJam Namespace

Clone this wiki locally