C# OJAI Client API
MapRDB.Driver.Ojai.OjaiQueryCondition Class Reference
Inheritance diagram for MapRDB.Driver.Ojai.OjaiQueryCondition:
MapRDB.Driver.Ojai.IQueryCondition

Public Member Functions

string ToJsonString ()
 Parse query condition into JSON string. More...
 
string ToJsonString (Formatting formatting)
 Parse query condition into JSON string. More...
 
IDictionary< string, Object > ToDictionary ()
 Parse query condition into dictionary. More...
 
IQueryCondition And ()
 Begins a new AND compound condition block. More...
 
IQueryCondition Or ()
 Begins a new OR compound condition block. More...
 
IQueryCondition ElementAnd (string path)
 Begins a new ElementAnd compound condition block. More...
 
IQueryCondition Close ()
 Closes a compound condition block. More...
 
IQueryCondition Build ()
 Builds this QueryCondition object and makes it immutable. More...
 
IQueryCondition Condition (IQueryCondition conditionToAdd)
 Appends the specified condition to the current condition block. More...
 
IQueryCondition Exists (string path)
 Adds a condition that tests for existence of the specified FieldPath. More...
 
IQueryCondition NotExists (string path)
 Adds a condition that tests for non-existence of the specified FieldPath. More...
 
IQueryCondition In (string path, IList< Object > listOfValue)
 Adds a condition that tests if the Value at the specified FieldPath is equal to at least one of the values in the specified List. More...
 
IQueryCondition NotIn (string path, IList< Object > listOfValue)
 Adds a condition that tests if the Value at the specified FieldPath is not equal to any of the values in the specified List. More...
 
IQueryCondition TypeOf (string path, Type type)
 Adds a condition that tests if the Value at the specified FieldPath is of the specified Type. More...
 
IQueryCondition NotTypeOf (string path, Type type)
 Adds a condition that tests if the Value at the specified FieldPath is not of the specified Type. More...
 
IQueryCondition Matches (string path, string regex)
 Adds a condition that tests if the Value at the specified FieldPath is a string and matches the specified regular expression. More...
 
IQueryCondition NotMatches (string path, string regex)
 Adds a condition that tests if the Value at the specified FieldPath is a string and not matches the specified regular expression. More...
 
IQueryCondition Like (string path, string likeExpression)
 Adds a condition that tests if the Value at the specified FieldPath is a string and matches the specified SQL LIKE expression. More...
 
IQueryCondition Like (string path, string likeExpression, char escapeChar)
 Adds a condition that tests if the Value at the specified FieldPath is a string and matches the specified SQL LIKE expression optionally escaped with the specified escape character. More...
 
IQueryCondition NotLike (string path, string likeExpression)
 Adds a condition that tests if the Value at the specified FieldPath is a string and not matches the specified SQL LIKE expression. More...
 
IQueryCondition NotLike (string path, string likeExpression, char escapeChar)
 Adds a condition that tests if the Value at the specified FieldPath is a string and not matches the specified SQL LIKE expression optionally escaped with the specified escape character. More...
 
IQueryCondition Is (string path, QueryOp op, bool value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified bool value. More...
 
IQueryCondition Is (string path, QueryOp op, string value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified string value. More...
 
IQueryCondition Is (string path, QueryOp op, byte value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified byte value. More...
 
IQueryCondition Is (string path, QueryOp op, short value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified short value. More...
 
IQueryCondition Is (string path, QueryOp op, int value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified int value. More...
 
IQueryCondition Is (string path, QueryOp op, long value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified long value. More...
 
IQueryCondition Is (string path, QueryOp op, float value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified float value. More...
 
IQueryCondition Is (string path, QueryOp op, double value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified double value. More...
 
IQueryCondition Is (string path, QueryOp op, decimal value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified decimal value. More...
 
IQueryCondition Is (string path, QueryOp op, OjaiDate value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified OjaiDate value. More...
 
IQueryCondition Is (string path, QueryOp op, OjaiTime value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified OjaiTime value. More...
 
IQueryCondition Is (string path, QueryOp op, OjaiTimestamp value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified OjaiTimestamp value. More...
 
IQueryCondition Is (string path, QueryOp op, OjaiInterval value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified OjaiInterval value. More...
 
IQueryCondition Is (string path, QueryOp op, byte[] value)
 Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified byte[] value. More...
 
IQueryCondition Equals (string path, IDictionary< string, Object > value)
 Adds a condition that tests if the Value at the specified FieldPath equals the specified Dictionary value. Two Dictionaries are considered equal if and only if they contain the same key-value pair in the same order. More...
 
IQueryCondition Equals (string path, IList< Object > value)
 Adds a condition that tests if the Value at the specified FieldPath equals the specified List value. More...
 
IQueryCondition NotEquals (string path, IDictionary< string, Object > value)
 Adds a condition that tests if the Value at the specified FieldPath not equals the specified Dictionary value. Two Dictionaries are considered equal if and only if they contain the same key-value pair in the same order. More...
 
IQueryCondition NotEquals (string path, IList< Object > value)
 Adds a condition that tests if the Value at the specified FieldPath not equals the specified List value. More...
 
IQueryCondition SizeOf (string path, QueryOp op, long size)
 Adds a condition that tests if the size of the Value at the specified FieldPath satisfies the given QueryOp and the size. The value must be one of the following types: string, binary, IDictionary or IList. More...
 

Public Attributes

bool IsEmpty => _queryDictionary.Count == 0
 

Properties

bool IsBuilt [get, private set]
 
- Properties inherited from MapRDB.Driver.Ojai.IQueryCondition
bool IsBuilt [get]
 
bool IsEmpty [get]
 

Private Member Functions

IQueryCondition SetIs (string path, QueryOp op, object value)
 Private method to set Is condition with given QueryOp against the specified value. More...
 
void BuildFromTokens ()
 Private method to build query condition fron token queue. More...
 
void MergeDictionaries (QueryDictionary dict1, QueryDictionary dict2)
 Private method to merge two dictionaries into first one. More...
 
void MergeLists (IList list1, IList list2)
 Private method to merge two lists into first one. More...
 
QueryDictionary BuildBlock (string op)
 Private method to build block of conditions. More...
 
IEnumerable< Object > ConvertList (IList< Object > list)
 Converts list of objects into list of their OJAI representation. More...
 

Private Attributes

Queue< Object > _tokens
 
QueryDictionary _queryDictionary
 

Member Function Documentation

◆ And()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.And ( )

Begins a new AND compound condition block.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Build()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Build ( )

Builds this QueryCondition object and makes it immutable.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ BuildBlock()

QueryDictionary MapRDB.Driver.Ojai.OjaiQueryCondition.BuildBlock ( string  op)
private

Private method to build block of conditions.

◆ BuildFromTokens()

void MapRDB.Driver.Ojai.OjaiQueryCondition.BuildFromTokens ( )
private

Private method to build query condition fron token queue.

◆ Close()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Close ( )

Closes a compound condition block.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Condition()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Condition ( IQueryCondition  conditionToAdd)

Appends the specified condition to the current condition block.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ ConvertList()

IEnumerable<Object> MapRDB.Driver.Ojai.OjaiQueryCondition.ConvertList ( IList< Object >  list)
private

Converts list of objects into list of their OJAI representation.

Parameters
list
Returns

◆ ElementAnd()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.ElementAnd ( string  path)

Begins a new ElementAnd compound condition block.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Equals() [1/2]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Equals ( string  path,
IDictionary< string, Object >  value 
)

Adds a condition that tests if the Value at the specified FieldPath equals the specified Dictionary value. Two Dictionaries are considered equal if and only if they contain the same key-value pair in the same order.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Equals() [2/2]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Equals ( string  path,
IList< Object >  value 
)

Adds a condition that tests if the Value at the specified FieldPath equals the specified List value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Exists()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Exists ( string  path)

Adds a condition that tests for existence of the specified FieldPath.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ In()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.In ( string  path,
IList< Object >  listOfValue 
)

Adds a condition that tests if the Value at the specified FieldPath is equal to at least one of the values in the specified List.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [1/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
bool  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified bool value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [2/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
string  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified string value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [3/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
byte  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified byte value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [4/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
short  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified short value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [5/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
int  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified int value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [6/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
long  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified long value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [7/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
float  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified float value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [8/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
double  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified double value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [9/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
decimal  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified decimal value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [10/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
OjaiDate  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified OjaiDate value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [11/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
OjaiTime  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified OjaiTime value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [12/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
OjaiTimestamp  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified OjaiTimestamp value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [13/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
OjaiInterval  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified OjaiInterval value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Is() [14/14]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Is ( string  path,
QueryOp  op,
byte []  value 
)

Adds a condition that tests if the Value at the specified FieldPath satisfies the given QueryOp against the specified byte[] value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Like() [1/2]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Like ( string  path,
string  likeExpression 
)

Adds a condition that tests if the Value at the specified FieldPath is a string and matches the specified SQL LIKE expression.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Like() [2/2]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Like ( string  path,
string  likeExpression,
char  escapeChar 
)

Adds a condition that tests if the Value at the specified FieldPath is a string and matches the specified SQL LIKE expression optionally escaped with the specified escape character.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Matches()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Matches ( string  path,
string  regex 
)

Adds a condition that tests if the Value at the specified FieldPath is a string and matches the specified regular expression.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ MergeDictionaries()

void MapRDB.Driver.Ojai.OjaiQueryCondition.MergeDictionaries ( QueryDictionary  dict1,
QueryDictionary  dict2 
)
private

Private method to merge two dictionaries into first one.

◆ MergeLists()

void MapRDB.Driver.Ojai.OjaiQueryCondition.MergeLists ( IList  list1,
IList  list2 
)
private

Private method to merge two lists into first one.

◆ NotEquals() [1/2]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.NotEquals ( string  path,
IDictionary< string, Object >  value 
)

Adds a condition that tests if the Value at the specified FieldPath not equals the specified Dictionary value. Two Dictionaries are considered equal if and only if they contain the same key-value pair in the same order.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ NotEquals() [2/2]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.NotEquals ( string  path,
IList< Object >  value 
)

Adds a condition that tests if the Value at the specified FieldPath not equals the specified List value.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ NotExists()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.NotExists ( string  path)

Adds a condition that tests for non-existence of the specified FieldPath.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ NotIn()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.NotIn ( string  path,
IList< Object >  listOfValue 
)

Adds a condition that tests if the Value at the specified FieldPath is not equal to any of the values in the specified List.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ NotLike() [1/2]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.NotLike ( string  path,
string  likeExpression 
)

Adds a condition that tests if the Value at the specified FieldPath is a string and not matches the specified SQL LIKE expression.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ NotLike() [2/2]

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.NotLike ( string  path,
string  likeExpression,
char  escapeChar 
)

Adds a condition that tests if the Value at the specified FieldPath is a string and not matches the specified SQL LIKE expression optionally escaped with the specified escape character.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ NotMatches()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.NotMatches ( string  path,
string  regex 
)

Adds a condition that tests if the Value at the specified FieldPath is a string and not matches the specified regular expression.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ NotTypeOf()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.NotTypeOf ( string  path,
Type  type 
)

Adds a condition that tests if the Value at the specified FieldPath is not of the specified Type.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ Or()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.Or ( )

Begins a new OR compound condition block.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ SetIs()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.SetIs ( string  path,
QueryOp  op,
object  value 
)
private

Private method to set Is condition with given QueryOp against the specified value.

◆ SizeOf()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.SizeOf ( string  path,
QueryOp  op,
long  size 
)

Adds a condition that tests if the size of the Value at the specified FieldPath satisfies the given QueryOp and the size. The value must be one of the following types: string, binary, IDictionary or IList.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ ToDictionary()

IDictionary<string, Object> MapRDB.Driver.Ojai.OjaiQueryCondition.ToDictionary ( )

Parse query condition into dictionary.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ ToJsonString() [1/2]

string MapRDB.Driver.Ojai.OjaiQueryCondition.ToJsonString ( )

Parse query condition into JSON string.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ ToJsonString() [2/2]

string MapRDB.Driver.Ojai.OjaiQueryCondition.ToJsonString ( Formatting  formatting)

Parse query condition into JSON string.

Implements MapRDB.Driver.Ojai.IQueryCondition.

◆ TypeOf()

IQueryCondition MapRDB.Driver.Ojai.OjaiQueryCondition.TypeOf ( string  path,
Type  type 
)

Adds a condition that tests if the Value at the specified FieldPath is of the specified Type.

Implements MapRDB.Driver.Ojai.IQueryCondition.