Interface IQueryEngineFilter
Interface for Query filters.
Namespace: UnityEditor.Search
Syntax
public interface IQueryEngineFilter
Properties
metaInfo
Additional information specific to the filter.
Declaration
IReadOnlyDictionary<string, string> metaInfo { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<String, String> |
operators
Collection of QueryFilterOperators specific for the filter.
Declaration
IReadOnlyDictionary<string, QueryFilterOperator> operators { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<String, QueryFilterOperator> |
overridesStringComparison
Indicates if the filter overrides the global string comparison options.
Declaration
bool overridesStringComparison { get; }
Property Value
Type | Description |
---|---|
Boolean |
parameterType
The type of the constant parameter passed to the filter.
Declaration
Type parameterType { get; }
Property Value
Type | Description |
---|---|
Type |
regexToken
The regular expression that matches the filter. Matches what precedes the operator in a filter (for example, "id" in "id>=2").
Declaration
Regex regexToken { get; }
Property Value
Type | Description |
---|---|
Regex |
stringComparison
The string comparison options of the filter.
Declaration
StringComparison stringComparison { get; }
Property Value
Type | Description |
---|---|
StringComparison |
supportedOperators
List of supported operators.
Declaration
IEnumerable<string> supportedOperators { get; }
Property Value
Type | Description |
---|---|
IEnumerable<String> |
token
The identifier of the filter. Typically what precedes the operator in a filter (for example, "id" in "id>=2").
Declaration
string token { get; }
Property Value
Type | Description |
---|---|
String |
type
The type of the data that is compared by the filter.
Declaration
Type type { get; }
Property Value
Type | Description |
---|---|
Type |
usesParameter
Indicates if the filter uses a parameter.
Declaration
bool usesParameter { get; }
Property Value
Type | Description |
---|---|
Boolean |
usesRegularExpressionToken
Indicates if the filter uses a regular expression token or not.
Declaration
bool usesRegularExpressionToken { get; }
Property Value
Type | Description |
---|---|
Boolean |
usesResolver
Indicates if the filter uses a resolver function.
Declaration
bool usesResolver { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
AddOperator(String)
Add a custom filter operator specific to the filter. If the operator already exists, the existing operator is returned.
Declaration
QueryFilterOperator AddOperator(string op)
Parameters
Type | Name | Description |
---|---|---|
String | op | The operator identifier. |
Returns
Type | Description |
---|---|
QueryFilterOperator | The added QueryFilterOperator. |
AddOrUpdateMetaInfo(String, String)
Add additional information specific to the filter.
Declaration
IQueryEngineFilter AddOrUpdateMetaInfo(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key of the information. |
String | value | The value of the information. |
Returns
Type | Description |
---|---|
IQueryEngineFilter | The current IQueryEngineFilter. |
AddTypeParser<TFilterConstant>(Func<String, ParseResult<TFilterConstant>>)
Add a type parser specific to the filter that parse a string and returns a custom type. Used by custom operator handlers.
Declaration
IQueryEngineFilter AddTypeParser<TFilterConstant>(Func<string, ParseResult<TFilterConstant>> parser)
Parameters
Type | Name | Description |
---|---|---|
Func<String, ParseResult<TFilterConstant>> | parser | Callback used to determine if a string can be converted into TFilterConstant. Takes a string and returns a ParseResult<T> object. This contains the success flag, and the actual converted value if it succeeded. |
Returns
Type | Description |
---|---|
IQueryEngineFilter | The current IQueryEngineFilter. |
Type Parameters
Name | Description |
---|---|
TFilterConstant | The type of the parsed operand that is on the right hand side of the operator. |
ClearMetaInfo()
Removes all additional information specific to the filter.
Declaration
IQueryEngineFilter ClearMetaInfo()
Returns
Type | Description |
---|---|
IQueryEngineFilter | The current IQueryEngineFilter. |
RemoveMetaInfo(String)
Remove information on the filter.
Declaration
IQueryEngineFilter RemoveMetaInfo(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key of the information. |
Returns
Type | Description |
---|---|
IQueryEngineFilter | The current IQueryEngineFilter. |
RemoveOperator(String)
Remove a custom operator specific to the filter.
Declaration
IQueryEngineFilter RemoveOperator(string op)
Parameters
Type | Name | Description |
---|---|---|
String | op | The operator identifier. |
Returns
Type | Description |
---|---|
IQueryEngineFilter | The current IQueryEngineFilter. |
SetNestedQueryTransformer<TNestedQueryData, TRhs>(Func<TNestedQueryData, TRhs>)
Set the filter's nested query transformer function. This function takes the result of a nested query and extract the necessary data to compare with the filter.
Declaration
void SetNestedQueryTransformer<TNestedQueryData, TRhs>(Func<TNestedQueryData, TRhs> transformer)
Parameters
Type | Name | Description |
---|---|---|
Func<TNestedQueryData, TRhs> | transformer | The transformer function. |
Type Parameters
Name | Description |
---|---|
TNestedQueryData | The type of data returned by the nested query. |
TRhs | The type expected on the right hand side of the filter. |