com.primus.searchcommon.constraint
Class NumericConstraint

java.lang.Object
  extended by com.primus.searchcommon.constraint.BaseConstraint
      extended by com.primus.searchcommon.constraint.NumericConstraint
All Implemented Interfaces:
DocumentSetConstraint, java.io.Serializable

public class NumericConstraint
extends BaseConstraint

Numeric value constraint on the query. Also used for date constraints by representing dates as long.

See Also:
Serialized Form

Field Summary
static java.lang.String BETWEEN
           
static java.lang.String CLASS_VERSION
           
static java.lang.String EQUAL
           
static java.lang.String GREATER
           
static java.lang.String GREATER_EQUAL
           
static java.lang.String LESS
           
static java.lang.String LESS_EQUAL
           
static java.lang.String WITHIN
           
 
Constructor Summary
NumericConstraint(java.lang.String pPropery, long pValue1)
           
NumericConstraint(java.lang.String pPropery, long pValue1, long value2)
           
NumericConstraint(java.lang.String pPropery, long pValue1, long pValue2, java.lang.String pOperation)
           
NumericConstraint(java.lang.String pPropery, long pValue1, long pValue2, java.lang.String pOperation, java.lang.Float pWeight)
           
NumericConstraint(java.lang.String pPropery, long pValue1, java.lang.String pOperation)
          Deprecated. Use NumericConstraint(String, long, long, String, Float) NOTE: Sets weight to null to use the default weight.
 
Method Summary
 java.lang.String getOperation()
           
 java.lang.String getProperty()
           
 long getValue1()
           
 long getValue2()
           
 java.lang.Float getWeight()
           
 void setWeight(java.lang.Float pWeight)
           
 java.lang.String toXml()
          Converts this constraint to the XML representation that can be sent in the ES Query.
 
Methods inherited from class com.primus.searchcommon.constraint.BaseConstraint
escapeToXml, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

GREATER

public static final java.lang.String GREATER
See Also:
Constant Field Values

GREATER_EQUAL

public static final java.lang.String GREATER_EQUAL
See Also:
Constant Field Values

LESS

public static final java.lang.String LESS
See Also:
Constant Field Values

LESS_EQUAL

public static final java.lang.String LESS_EQUAL
See Also:
Constant Field Values

EQUAL

public static final java.lang.String EQUAL
See Also:
Constant Field Values

WITHIN

public static final java.lang.String WITHIN
See Also:
Constant Field Values

BETWEEN

public static final java.lang.String BETWEEN
See Also:
Constant Field Values
Constructor Detail

NumericConstraint

public NumericConstraint(java.lang.String pPropery,
                         long pValue1)
Parameters:
pPropery -
pValue1 -

NumericConstraint

public NumericConstraint(java.lang.String pPropery,
                         long pValue1,
                         long value2)
Parameters:
pPropery -
pValue1 -
value2 - use only for within and between types

NumericConstraint

public NumericConstraint(java.lang.String pPropery,
                         long pValue1,
                         java.lang.String pOperation)
Deprecated. Use NumericConstraint(String, long, long, String, Float) NOTE: Sets weight to null to use the default weight.

Parameters:
pPropery -
pValue1 -
pValue2 - use only for within and between types
pOperation - pass null for default

NumericConstraint

public NumericConstraint(java.lang.String pPropery,
                         long pValue1,
                         long pValue2,
                         java.lang.String pOperation)
Parameters:
pPropery -
pValue1 -
pValue2 - use only for within and between types
pOperation - pass null for default
pWeight - pass null for default

NumericConstraint

public NumericConstraint(java.lang.String pPropery,
                         long pValue1,
                         long pValue2,
                         java.lang.String pOperation,
                         java.lang.Float pWeight)
Parameters:
pPropery -
pValue1 -
pValue2 - use only for within and between types
pOperation - pass null for default
pWeight - pass null for default
Method Detail

getWeight

public java.lang.Float getWeight()

setWeight

public void setWeight(java.lang.Float pWeight)

getOperation

public java.lang.String getOperation()
Returns:
Returns the operation.

getProperty

public java.lang.String getProperty()
Returns:
Returns the property.

getValue1

public long getValue1()
Returns:
Returns the value1.

getValue2

public long getValue2()
Returns:
Returns the value2.

toXml

public java.lang.String toXml()
Description copied from interface: DocumentSetConstraint
Converts this constraint to the XML representation that can be sent in the ES Query.

Returns: