com.semarchy.mdm.runtime.data
Class QueryCondition

java.lang.Object
  extended by com.semarchy.mdm.runtime.data.QueryCondition
All Implemented Interfaces:
Serializable

public class QueryCondition
extends Object
implements Serializable

Represents a condition fragment with some named binding values. Useful for condition composition

Author:
sarod
See Also:
Serialized Form

Constructor Summary
QueryCondition(String condition)
          Creates a QueryCondition
QueryCondition(String condition, Map<String,Object> bindings)
          Creates a QueryCondition
 
Method Summary
static QueryCondition and(List<QueryCondition> conditions)
          Create a query condition "ANDing" the providing conditions
static QueryCondition and(QueryCondition... conditions)
          Create a query condition "ANDing" the providing conditions
 boolean equals(Object obj)
           
 Map<String,Object> getBindings()
          Binding value map
 String getCondition()
          The SemQL condition
 int hashCode()
           
static QueryCondition not(QueryCondition condition)
          Create a query condition "ANDing" the providing conditions
static QueryCondition or(List<QueryCondition> conditions)
          Create a query condition "ORing" the providing conditions
static QueryCondition or(QueryCondition... conditions)
          Create a query condition "ORing" the providing conditions
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryCondition

public QueryCondition(String condition,
                      Map<String,Object> bindings)
Creates a QueryCondition

Parameters:
condition - the SemQL condition
bindings - the binding values for the named binding used in SemQL condition.

QueryCondition

public QueryCondition(String condition)
Creates a QueryCondition

Parameters:
condition - the SemQL condition
Method Detail

getCondition

public String getCondition()
The SemQL condition

Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getBindings

public Map<String,Object> getBindings()
Binding value map

Returns:

and

public static QueryCondition and(List<QueryCondition> conditions)
Create a query condition "ANDing" the providing conditions

Parameters:
conditions -
Returns:
the Anded condition or null if there is 0 non null condition in the conditions list

not

public static QueryCondition not(QueryCondition condition)
Create a query condition "ANDing" the providing conditions

Parameters:
conditions -
Returns:
the Anded condition or null if there is 0 non null condition in the conditions list

and

public static QueryCondition and(QueryCondition... conditions)
Create a query condition "ANDing" the providing conditions

Parameters:
conditions -
Returns:
the Anded condition or null if there is 0 non null condition in the conditions list

or

public static QueryCondition or(QueryCondition... conditions)
Create a query condition "ORing" the providing conditions

Parameters:
conditions -
Returns:
the ORed condition or null if there is 0 non null condition in the conditions list

or

public static QueryCondition or(List<QueryCondition> conditions)
Create a query condition "ORing" the providing conditions

Parameters:
conditions -
Returns:
the ORed condition or null if there is 0 non null condition in the conditions list

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015. All Rights Reserved.