/** * Create geospatial "containing point" filter for query. * * @param name bin name * @param point GeoJSON point * @return filter instance */ public static Filter geoContains(String name, String point) { return new Filter(name, IndexCollectionType.DEFAULT, ParticleType.GEOJSON, Value.get(point), Value.get(point)); }
/** * Create geospatial "within region" filter for query on collection index. * * @param name bin name * @param type index collection type * @param region GeoJSON region * @return filter instance */ public static Filter geoWithinRegion(String name, IndexCollectionType type, String region) { return new Filter(name, type, ParticleType.GEOJSON, Value.get(region), Value.get(region)); }
/** * Create geospatial "within radius" filter for query. * * @param name bin name * @param lng longitude * @param lat latitude * @param radius radius (meters) * @return filter instance */ public static Filter geoWithinRadius(String name, double lng, double lat, double radius) { String rgnstr = String.format("{ \"type\": \"AeroCircle\", " + "\"coordinates\": [[%.8f, %.8f], %f] }", lng, lat, radius); return new Filter(name, IndexCollectionType.DEFAULT, ParticleType.GEOJSON, Value.get(rgnstr), Value.get(rgnstr)); }
/** * Create long equality filter for query. * * @param name bin name * @param value filter value * @return filter instance */ public static Filter equal(String name, long value) { Value val = Value.get(value); return new Filter(name, IndexCollectionType.DEFAULT, val.getType(), val, val); }
/** * Create range filter for query. * Range arguments must be longs or integers which can be cast to longs. * String ranges are not supported. * * @param name bin name * @param begin filter begin value inclusive * @param end filter end value inclusive * @return filter instance */ public static Filter range(String name, long begin, long end) { return new Filter(name, IndexCollectionType.DEFAULT, ParticleType.INTEGER, Value.get(begin), Value.get(end)); }
/** * Create geospatial "within region" filter for query on collection index. * * @param name bin name * @param type index collection type * @param region GeoJSON region * @return filter instance */ public static Filter geoWithinRegion(String name, IndexCollectionType type, String region) { return new Filter(name, type, ParticleType.GEOJSON, Value.get(region), Value.get(region)); }
/** * Create geospatial "containing point" filter for query on collection index. * * @param name bin name * @param type index collection type * @param point GeoJSON point. * @return filter instance */ public static Filter geoContains(String name, IndexCollectionType type, String point) { return new Filter(name, type, ParticleType.GEOJSON, Value.get(point), Value.get(point)); }
/** * Create string equality filter for query. * * @param name bin name * @param value filter value * @return filter instance */ public static Filter equal(String name, String value) { Value val = Value.get(value); return new Filter(name, IndexCollectionType.DEFAULT, val.getType(), val, val); }
/** * Create geospatial "containing point" filter for query. * * @param name bin name * @param point GeoJSON point * @return filter instance */ public static Filter geoContains(String name, String point) { return new Filter(name, IndexCollectionType.DEFAULT, ParticleType.GEOJSON, Value.get(point), Value.get(point)); }
/** * Create geospatial "containing point" filter for query on collection index. * * @param name bin name * @param type index collection type * @param point GeoJSON point. * @return filter instance */ public static Filter geoContains(String name, IndexCollectionType type, String point) { return new Filter(name, type, ParticleType.GEOJSON, Value.get(point), Value.get(point)); }
/** * Create contains string filter for query on collection index. * * @param name bin name * @param type index collection type * @param value filter value * @return filter instance */ public static Filter contains(String name, IndexCollectionType type, String value) { Value val = Value.get(value); return new Filter(name, type, val.getType(), val, val); }
/** * Create geospatial "within region" filter for query. * * @param name bin name * @param region GeoJSON region * @return filter instance */ public static Filter geoWithinRegion(String name, String region) { return new Filter(name, IndexCollectionType.DEFAULT, ParticleType.GEOJSON, Value.get(region), Value.get(region)); }
/** * Create long equality filter for query. * * @param name bin name * @param value filter value * @return filter instance */ public static Filter equal(String name, long value) { Value val = Value.get(value); return new Filter(name, IndexCollectionType.DEFAULT, val.getType(), val, val); }
/** * Create contains number filter for query on collection index. * * @param name bin name * @param type index collection type * @param value filter value * @return filter instance */ public static Filter contains(String name, IndexCollectionType type, long value) { Value val = Value.get(value); return new Filter(name, type, val.getType(), val, val); }
/** * Create contains string filter for query on collection index. * * @param name bin name * @param type index collection type * @param value filter value * @return filter instance */ public static Filter contains(String name, IndexCollectionType type, String value) { Value val = Value.get(value); return new Filter(name, type, val.getType(), val, val); }
/** * Create geospatial "within region" filter for query. * * @param name bin name * @param region GeoJSON region * @return filter instance */ public static Filter geoWithinRegion(String name, String region) { return new Filter(name, IndexCollectionType.DEFAULT, ParticleType.GEOJSON, Value.get(region), Value.get(region)); }
/** * Create string equality filter for query. * * @param name bin name * @param value filter value * @return filter instance */ public static Filter equal(String name, String value) { Value val = Value.get(value); return new Filter(name, IndexCollectionType.DEFAULT, val.getType(), val, val); }
/** * Create contains number filter for query on collection index. * * @param name bin name * @param type index collection type * @param value filter value * @return filter instance */ public static Filter contains(String name, IndexCollectionType type, long value) { Value val = Value.get(value); return new Filter(name, type, val.getType(), val, val); }
/** * Create range filter for query. * Range arguments must be longs or integers which can be cast to longs. * String ranges are not supported. * * @param name bin name * @param begin filter begin value inclusive * @param end filter end value inclusive * @return filter instance */ public static Filter range(String name, long begin, long end) { return new Filter(name, IndexCollectionType.DEFAULT, ParticleType.INTEGER, Value.get(begin), Value.get(end)); }
/** * Create range filter for query on collection index. * Range arguments must be longs or integers which can be cast to longs. * String ranges are not supported. * * @param name bin name * @param type index collection type * @param begin filter begin value inclusive * @param end filter end value inclusive * @return filter instance */ public static Filter range(String name, IndexCollectionType type, long begin, long end) { return new Filter(name, type, ParticleType.INTEGER, Value.get(begin), Value.get(end)); }