com.stackmob.sdk.api
Class StackMobQueryField

java.lang.Object
  extended by com.stackmob.sdk.api.StackMobQueryField

public class StackMobQueryField
extends Object

Represents a part of a query being executed on a specific field. This is meant to be used as part of a chain with StackMobQuery,

 StackMobQuery query = new StackMobQuery("user")
                             .field(new StackMobQueryField("age").isGreaterThan(20).isLessThanOrEqualTo(40))
                             .field(new StackMobQueryField("friend").isIn(Arrays.asList("joe", "bob", "alice")));
 
 


Constructor Summary
StackMobQueryField(String field)
          extend the given query with constraints on the given field
 
Method Summary
 String getField()
          get the field being constrained
 StackMobQuery getQuery()
          get the actual query to be used or extended further
 StackMobQueryField isEqualTo(Boolean val)
          add an equality constraint to the field
 StackMobQueryField isEqualTo(Integer val)
          add an equality constraint to the field
 StackMobQueryField isEqualTo(Long val)
          add an equality constraint to the field
 StackMobQueryField isEqualTo(String val)
          add an equality constraint to the field
 StackMobQueryField isGreaterThan(Boolean val)
          add a greater than constraint to the field
 StackMobQueryField isGreaterThan(Integer val)
          add a greater than constraint to the field
 StackMobQueryField isGreaterThan(Long val)
          add a greater than constraint to the field
 StackMobQueryField isGreaterThan(String val)
          add a greater than constraint to the field
 StackMobQueryField isGreaterThanOrEqualTo(Boolean val)
          add a greater than or equal to constraint to the field
 StackMobQueryField isGreaterThanOrEqualTo(Integer val)
          add a greater than or equal to constraint to the field
 StackMobQueryField isGreaterThanOrEqualTo(Long val)
          add a greater than or equal to constraint to the field
 StackMobQueryField isGreaterThanOrEqualTo(String val)
          add a greater than or equal to constraint to the field
 StackMobQueryField isIn(List<String> values)
          Constrain the field to be in a set of values
 StackMobQueryField isLessThan(Boolean val)
          add a less than constraint to the field
 StackMobQueryField isLessThan(Integer val)
          add a less than constraint to the field
 StackMobQueryField isLessThan(Long val)
          add a less than constraint to the field
 StackMobQueryField isLessThan(String val)
          add a less than constraint to the field
 StackMobQueryField isLessThanOrEqualTo(Boolean val)
          add a less than or equal to constraint to the field
 StackMobQueryField isLessThanOrEqualTo(Integer val)
          add a less than or equal to constraint to the field
 StackMobQueryField isLessThanOrEqualTo(Long val)
          add a less than or equal to constraint to the field
 StackMobQueryField isLessThanOrEqualTo(String val)
          add a less than or equal to constraint to the field
 StackMobQueryField isNear(StackMobGeoPoint point)
          add an constraint that this field, which should be a geopoint, is near to another point
 StackMobQueryField isNearWithinKm(StackMobGeoPoint point, Double maxDistanceKm)
          add an constraint that this field, which should be a geopoint, is within a certain distance of another point
 StackMobQueryField isNearWithinMi(StackMobGeoPoint point, Double maxDistanceMi)
          add an constraint that this field, which should be a geopoint, is within a certain distance of another point
 StackMobQueryField isNotEqualTo(Boolean val)
          add an inequality constraint to the field
 StackMobQueryField isNotEqualTo(Integer val)
          add an inequality constraint to the field
 StackMobQueryField isNotEqualTo(Long val)
          add an inequality constraint to the field
 StackMobQueryField isNotEqualTo(String val)
          add an inequality constraint to the field
 StackMobQueryField isNotIn(List<String> values)
          Constrain the field to be not in a set of values
 StackMobQueryField isNotNull()
          add an not null constraint to the field
 StackMobQueryField isNull()
          add an null constraint to the field
 StackMobQueryField isOrderedBy(StackMobQuery.Ordering ordering)
          add an ordering on this field
 StackMobQueryField isWithinBox(StackMobGeoPoint lowerLeft, StackMobGeoPoint upperRight)
          add an constraint that this field, which should be a geopoint, is within the box defined by two other points
 StackMobQueryField isWithinKm(StackMobGeoPoint point, Double radiusKm)
          add an constraint that this field, which should be a geopoint, is within a certain distance of another point
 StackMobQueryField isWithinMi(StackMobGeoPoint point, Double radiusMi)
          add an constraint that this field, which should be a geopoint, is within a certain distance of another point
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackMobQueryField

public StackMobQueryField(String field)
extend the given query with constraints on the given field

Parameters:
field -
Method Detail

getQuery

public StackMobQuery getQuery()
get the actual query to be used or extended further

Returns:
a query with all the constraints set in this object

getField

public String getField()
get the field being constrained

Returns:
the field

isEqualTo

public StackMobQueryField isEqualTo(String val)
add an equality constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isEqualTo

public StackMobQueryField isEqualTo(Integer val)
add an equality constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isEqualTo

public StackMobQueryField isEqualTo(Long val)
add an equality constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isEqualTo

public StackMobQueryField isEqualTo(Boolean val)
add an equality constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isNotEqualTo

public StackMobQueryField isNotEqualTo(String val)
add an inequality constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isNotEqualTo

public StackMobQueryField isNotEqualTo(Integer val)
add an inequality constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isNotEqualTo

public StackMobQueryField isNotEqualTo(Long val)
add an inequality constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isNotEqualTo

public StackMobQueryField isNotEqualTo(Boolean val)
add an inequality constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isNull

public StackMobQueryField isNull()
add an null constraint to the field

Returns:
a new query with the constraint

isNotNull

public StackMobQueryField isNotNull()
add an not null constraint to the field

Returns:
a new query with the constraint

isNear

public StackMobQueryField isNear(StackMobGeoPoint point)
add an constraint that this field, which should be a geopoint, is near to another point

Parameters:
point - the value against which to test
Returns:
a new query with the constraint

isNearWithinMi

public StackMobQueryField isNearWithinMi(StackMobGeoPoint point,
                                         Double maxDistanceMi)
add an constraint that this field, which should be a geopoint, is within a certain distance of another point

Parameters:
point - the value against which to test
maxDistanceMi - the maximum distance
Returns:
a new query with the constraint

isNearWithinKm

public StackMobQueryField isNearWithinKm(StackMobGeoPoint point,
                                         Double maxDistanceKm)
add an constraint that this field, which should be a geopoint, is within a certain distance of another point

Parameters:
point - the value against which to test
maxDistanceKm - the maximum distance
Returns:
a new query with the constraint

isWithinMi

public StackMobQueryField isWithinMi(StackMobGeoPoint point,
                                     Double radiusMi)
add an constraint that this field, which should be a geopoint, is within a certain distance of another point

Parameters:
point - the value against which to test
radiusMi - the maximum distance
Returns:
a new query with the constraint

isWithinKm

public StackMobQueryField isWithinKm(StackMobGeoPoint point,
                                     Double radiusKm)
add an constraint that this field, which should be a geopoint, is within a certain distance of another point

Parameters:
point - the value against which to test
radiusKm - the maximum distance
Returns:
a new query with the constraint

isWithinBox

public StackMobQueryField isWithinBox(StackMobGeoPoint lowerLeft,
                                      StackMobGeoPoint upperRight)
add an constraint that this field, which should be a geopoint, is within the box defined by two other points

Parameters:
lowerLeft - the lower left corner of the box
upperRight - the upper right corner of the box
Returns:
a new query with the constraint

isIn

public StackMobQueryField isIn(List<String> values)
Constrain the field to be in a set of values

Parameters:
values - the values against which to test
Returns:
a new query with the constraint

isNotIn

public StackMobQueryField isNotIn(List<String> values)
Constrain the field to be not in a set of values

Parameters:
values - the values against which to test
Returns:
a new query with the constraint

isLessThan

public StackMobQueryField isLessThan(String val)
add a less than constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isLessThan

public StackMobQueryField isLessThan(Integer val)
add a less than constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isLessThan

public StackMobQueryField isLessThan(Long val)
add a less than constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isLessThan

public StackMobQueryField isLessThan(Boolean val)
add a less than constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isGreaterThan

public StackMobQueryField isGreaterThan(String val)
add a greater than constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isGreaterThan

public StackMobQueryField isGreaterThan(Integer val)
add a greater than constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isGreaterThan

public StackMobQueryField isGreaterThan(Long val)
add a greater than constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isGreaterThan

public StackMobQueryField isGreaterThan(Boolean val)
add a greater than constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isLessThanOrEqualTo

public StackMobQueryField isLessThanOrEqualTo(String val)
add a less than or equal to constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isLessThanOrEqualTo

public StackMobQueryField isLessThanOrEqualTo(Integer val)
add a less than or equal to constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isLessThanOrEqualTo

public StackMobQueryField isLessThanOrEqualTo(Long val)
add a less than or equal to constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isLessThanOrEqualTo

public StackMobQueryField isLessThanOrEqualTo(Boolean val)
add a less than or equal to constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isGreaterThanOrEqualTo

public StackMobQueryField isGreaterThanOrEqualTo(String val)
add a greater than or equal to constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isGreaterThanOrEqualTo

public StackMobQueryField isGreaterThanOrEqualTo(Integer val)
add a greater than or equal to constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isGreaterThanOrEqualTo

public StackMobQueryField isGreaterThanOrEqualTo(Long val)
add a greater than or equal to constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isGreaterThanOrEqualTo

public StackMobQueryField isGreaterThanOrEqualTo(Boolean val)
add a greater than or equal to constraint to the field

Parameters:
val - the value against which to test
Returns:
a new query with the constraint

isOrderedBy

public StackMobQueryField isOrderedBy(StackMobQuery.Ordering ordering)
add an ordering on this field

Parameters:
ordering - how results will be ordered using this field
Returns:
a new query with the constraint


Copyright © 2013 StackMob. All Rights Reserved.