Test additional content header

OptionT Class

Class that is a logical equivalent to native enum and used to define a set of constant options.

Definition

Namespace: Fluent.Calculations.Primitives.BaseTypes
Assembly: Fluent.Calculations.Primitives (in Fluent.Calculations.Primitives.dll) Version: 1.1.0-aplha
public class Option<T> : Value, IEqualityOperators<Option<T>, Option<T>, Condition>
where T : struct, new()
Inheritance
Object    Value    OptionT
Implements
IEqualityOperatorsOptionT, OptionT, Condition

Type Parameters

T
Type of underlying the Enum.

Remarks

This class enables use of SwithcExpression swithc/case expression builder.

Properties

ExpressionMetadata of expression that yielded this value.
(Inherited from Value)
NameName of value
(Inherited from Value)
OriginOrigin type of the value.
(Inherited from Value)
PrimitiveNumeric primitive representation of the value.
(Inherited from Value)
PrimitiveStringFormatted string representation of the Option Enum value
(Overrides ValuePrimitiveString)
ScopeNamed scope that this value is part of
(Inherited from Value)
TagsCustom tags associated with the value.
(Inherited from Value)
TypeOriginal type of the value implementation.
(Inherited from Value)

Methods

Equals(IValueProvider) Determines whether two Values are equal based on underlying primitive value.
(Inherited from Value)
Equals(Object)Determines whether two Values are equal based on underlying primitive value.
(Overrides ValueEquals(Object))
GetHashCodeServes as the default hash function, returns hash of the Primitive property value. This function is a subject to future change.
(Overrides ValueGetHashCode)
HandleBinaryOperationResultType, ResultPrimitiveType Handles math and comparison operations of underlying primitve values in derived types.
(Inherited from Value)
MakeDefaultInitializes a new instance with default values, equivalent to zero/null value.
(Overrides ValueMakeDefault)
MakeOfThisTypeInitializes a new instance of the Option class.
(Overrides ValueMakeOfThisType(MakeValueArgs))
SwitchTResultInvokes Switch expression builder to be used in Evaluate() method of EvaluationScope.
ToStringReturns a string that represents the current value.
(Inherited from Value)

Operators

Equality(OptionT, OptionT)Compares two Options to determine equality.
(T to OptionT) Makes an implicit conversion from the Enum type to Option.
(OptionT to T) Makes an implicit conversion from the Option to its underlying Enum type.
Inequality(OptionT, OptionT)Compares two Options to determine inequality.

See Also