-
Notifications
You must be signed in to change notification settings - Fork 35
T_CodeJam_ValueOption_1
Andrew Koryavchenko edited this page Jun 17, 2018
·
5 revisions
Represents a value type that can be assigned null.
Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public struct ValueOption<T> : IOption<T>,
IEquatable<ValueOption<T>>
VB
Public Structure ValueOption(Of T)
Implements IOption(Of T), IEquatable(Of ValueOption(Of T))
F#
[<SealedAttribute>]
type ValueOption<'T> =
struct
interface IOption<'T>
interface IEquatable<ValueOption<'T>>
end
- T
Name | Description | |
---|---|---|
ValueOption(T) | Initializes a new instance to the specified value. |
Name | Description | |
---|---|---|
HasValue | Gets a value indicating whether the current object has a value. | |
Value | Gets the value of the current object. |
Name | Description | |
---|---|---|
Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides ValueType.Equals(Object).) | |
Equals(ValueOption(T)) | Indicates whether the current object is equal to another object of the same type. | |
GetHashCode | Returns the hash code for this instance. (Overrides ValueType.GetHashCode().) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns the fully qualified type name of this instance. (Overrides ValueType.ToString().) |
Name | Description | |
---|---|---|
Equality | Equality operator. | |
Explicit(ValueOption(T) to T) | Extracts value from option | |
Implicit(T to ValueOption(T)) | Creates a new object initialized to a specified value. | |
Inequality | Unequality operator. |
Name | Description | |
---|---|---|
Do(T) | Calls someAction if option has value, and noneAction otherwise. (Defined by Option.) | |
GetValueOrDefault(T)(T) | Overloaded. Returns value of option, or defaultValue if option hasn't it. (Defined by Option.) |
|
GetValueOrDefault(T, TResult)(Func(IOption(T), TResult), Func(TResult)) | Overloaded. Calls someSelector if option has value, and noneSelector otherwise. (Defined by Option.) |
|
With(T, TResult)(Func(T, TResult)) | Overloaded. Converts option value to another option with selectFunc. (Defined by ValueOption.) |
|
With(T, TResult)(Func(T, TResult), TResult) | Overloaded. Converts option value to another option with selectFunc. (Defined by ValueOption.) |
|
With(T, TResult)(Func(T, TResult), Func(TResult)) | Overloaded. Converts option value to another option with selectFunc. (Defined by ValueOption.) |