Struct Opt<T>
Type for immutable options.
Assembly: Hgk.Zero.Options.dll
Syntax
public struct Opt<T> : IOpt<T>, IOpt, IEquatable<IOpt>, IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name |
Description |
T |
Contained type for options of this type.
|
Properties
|
Improve this Doc
View Source
HasValue
Gets whether this option contains a value.
Declaration
public bool HasValue { get; }
Property Value
|
Improve this Doc
View Source
Value
Gets the value contained by this option.
Declaration
Property Value
Exceptions
Methods
|
Improve this Doc
View Source
Equals(Object)
Gets whether this option is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
An object to compare this option to.
|
Returns
Type |
Description |
Boolean |
true if this option equals obj ; otherwise, false.
|
Overrides
|
Improve this Doc
View Source
GetHashCode()
Gets a hash code for this object based on its contents.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
Int32 |
A hash code for this option.
|
Overrides
|
Improve this Doc
View Source
ToString()
Gets a string representation for this option.
Declaration
public override string ToString()
Returns
Type |
Description |
String |
A string representation for this option.
|
Overrides
|
Improve this Doc
View Source
TryGetValue(out T)
Gets the value contained by this option, if it exists.
Declaration
public bool TryGetValue(out T value)
Parameters
Type |
Name |
Description |
T |
value |
When this method returns, is set to the value contained by this option, if any, or the
default value of T , otherwise.
|
Returns
Type |
Description |
Boolean |
true, if source contains a value; otherwise, false.
|
Explicit Interface Implementations
|
Improve this Doc
View Source
IOpt.ResolveUntypedOption<TResult>(Func<Boolean, Object, TResult>)
Declaration
TResult IOpt.ResolveUntypedOption<TResult>(Func<bool, object, TResult> resultSelector)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
IOpt<T>.ResolveOption<TResult>(Func<Boolean, T, TResult>)
Declaration
TResult IOpt<T>.ResolveOption<TResult>(Func<bool, T, TResult> resultSelector)
Parameters
Type |
Name |
Description |
Func<Boolean, T, TResult> |
resultSelector |
|
Returns
Type Parameters
|
Improve this Doc
View Source
ICollection<T>.Add(T)
Declaration
void ICollection<T>.Add(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
|
Improve this Doc
View Source
ICollection<T>.Clear()
Declaration
void ICollection<T>.Clear()
|
Improve this Doc
View Source
ICollection<T>.Contains(T)
Declaration
bool ICollection<T>.Contains(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Returns
|
Improve this Doc
View Source
ICollection<T>.CopyTo(T[], Int32)
Declaration
void ICollection<T>.CopyTo(T[] array, int arrayIndex)
Parameters
Type |
Name |
Description |
T[] |
array |
|
Int32 |
arrayIndex |
|
|
Improve this Doc
View Source
ICollection<T>.Count
Declaration
int ICollection<T>.Count { get; }
Returns
|
Improve this Doc
View Source
ICollection<T>.IsReadOnly
Declaration
bool ICollection<T>.IsReadOnly { get; }
Returns
|
Improve this Doc
View Source
ICollection<T>.Remove(T)
Declaration
bool ICollection<T>.Remove(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Returns
|
Improve this Doc
View Source
IEnumerable<T>.GetEnumerator()
Declaration
IEnumerator<T> IEnumerable<T>.GetEnumerator()
Returns
|
Improve this Doc
View Source
IList<T>.IndexOf(T)
Declaration
int IList<T>.IndexOf(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Returns
|
Improve this Doc
View Source
IList<T>.Insert(Int32, T)
Declaration
void IList<T>.Insert(int index, T item)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
T |
item |
|
|
Improve this Doc
View Source
IList<T>.Item[Int32]
Declaration
T IList<T>.this[int index] { get; set; }
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Returns
|
Improve this Doc
View Source
IList<T>.RemoveAt(Int32)
Declaration
void IList<T>.RemoveAt(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
|
Improve this Doc
View Source
IReadOnlyCollection<T>.Count
Declaration
int IReadOnlyCollection<T>.Count { get; }
Returns
|
Improve this Doc
View Source
IReadOnlyList<T>.Item[Int32]
Declaration
T IReadOnlyList<T>.this[int index] { get; }
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Returns
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
|
Improve this Doc
View Source
IEquatable<IOpt>.Equals(IOpt)
Declaration
bool IEquatable<IOpt>.Equals(IOpt other)
Parameters
Type |
Name |
Description |
IOpt |
other |
|
Returns
Implements
Extension Methods
LinqToOpt.GroupBy<TSource, TKey, TElement, TResult>(IOpt<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, Func<TKey, IOpt<TElement>, TResult>)
LinqToOpt.GroupBy<TSource, TKey, TElement, TResult>(IOpt<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, Func<TKey, IOpt<TElement>, TResult>, IEqualityComparer<TKey>)
LinqToOpt.GroupJoin<TOuter, TInner, TKey, TResult>(IOpt<TOuter>, IEnumerable<TInner>, Func<TOuter, TKey>, Func<TInner, TKey>, Func<TOuter, IEnumerable<TInner>, TResult>)
LinqToOpt.GroupJoin<TOuter, TInner, TKey, TResult>(IOpt<TOuter>, IEnumerable<TInner>, Func<TOuter, TKey>, Func<TInner, TKey>, Func<TOuter, IEnumerable<TInner>, TResult>, IEqualityComparer<TKey>)
LinqToOpt.GroupJoin<TOuter, TInner, TKey, TResult>(IOpt<TOuter>, IOpt<TInner>, Func<TOuter, TKey>, Func<TInner, TKey>, Func<TOuter, IOpt<TInner>, TResult>)
LinqToOpt.GroupJoin<TOuter, TInner, TKey, TResult>(IOpt<TOuter>, IOpt<TInner>, Func<TOuter, TKey>, Func<TInner, TKey>, Func<TOuter, IOpt<TInner>, TResult>, IEqualityComparer<TKey>)
LinqToOpt.Join<TOuter, TInner, TKey, TResult>(IOpt<TOuter>, IOpt<TInner>, Func<TOuter, TKey>, Func<TInner, TKey>, Func<TOuter, TInner, TResult>)
LinqToOpt.Join<TOuter, TInner, TKey, TResult>(IOpt<TOuter>, IOpt<TInner>, Func<TOuter, TKey>, Func<TInner, TKey>, Func<TOuter, TInner, TResult>, IEqualityComparer<TKey>)