Class OptionHandlerResult<T>
- Namespace
- Albatross.CommandLine
- Assembly
- Albatross.CommandLine.dll
Wraps the result of an option handler that may or may not produce a value.
public record OptionHandlerResult<T> : IEquatable<OptionHandlerResult<T>> where T : notnull
Type Parameters
TThe type of the value.
- Inheritance
-
OptionHandlerResult<T>
- Implements
- Inherited Members
Constructors
OptionHandlerResult()
Creates an empty result with no value.
public OptionHandlerResult()
OptionHandlerResult(T)
Creates a result containing the specified value.
public OptionHandlerResult(T value)
Parameters
valueTThe value to wrap.
Properties
HasValue
Gets a value indicating whether this result contains a value.
public bool HasValue { get; }
Property Value
Value
Gets the contained value. Throws if HasValue is false.
public T Value { get; }
Property Value
- T
Exceptions
- InvalidOperationException
Thrown when accessing the value when HasValue is false.