Struct ArrayFilter<T>
- Namespace
- MassiveDotNet
- Assembly
- MassiveDotNet.dll
A filter over an array-valued field such as tickers: arrays that contain a value, any
of several values, or all of them.
public readonly struct ArrayFilter<T>
Type Parameters
TThe array's element type.
- Inherited Members
Remarks
Build one with the factories on ArrayFilter. A plain T
converts implicitly to Contains<T>(T), and a
SetFilter<T> converts to the matching form, so SetFilter.AnyOf can be
passed wherever an array filter is expected. An unset filter (default)
renders nothing, exactly like a null parameter.
Operators
implicit operator ArrayFilter<T>(SetFilter<T>)
Converts a set filter. Any-of stays any-of; an equality becomes a contains filter, which is what the plain form of an array field means.
public static implicit operator ArrayFilter<T>(SetFilter<T> filter)
Parameters
filterSetFilter<T>The set filter.
Returns
- ArrayFilter<T>
implicit operator ArrayFilter<T>(T?)
Converts a value to a contains filter: field=value.
public static implicit operator ArrayFilter<T>(T? value)
Parameters
valueTThe value the array must contain, or null to produce an unset filter that renders nothing.
Returns
- ArrayFilter<T>
Remarks
Checks for null itself rather than delegating straight to
Contains<T>(T), which throws. The parameter is annotated
T? rather than T; for this unconstrained type parameter that is
annotation-only, so a reference-type T may be null while a
value-type T is unaffected -- there is no
Nullable<T> wrapping. The annotation states what this operator actually
does: a null reference, such as a string? ticker = null variable passed where a
filter is expected, converts to an unset filter instead of throwing
ArgumentNullException for a parameter (value) the caller never wrote.