/** * Constructor, specifying bin name and byte array value. * For servers configured as "single-bin", enter a null or empty name. * * @param name bin name, current limit is 14 characters * @param value bin value */ public Bin(String name, byte[] value) { this.name = name; this.value = Value.get(value); }
/** * 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); }
/** * Constructor, specifying bin name and long value. * For servers configured as "single-bin", enter a null or empty name. * * @param name bin name, current limit is 14 characters * @param value bin value */ public Bin(String name, long value) { this.name = name; this.value = Value.get(value); }
/** * 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); }
/** * Constructor, specifying bin name and double value. * <p> * For servers configured as "single-bin", enter a null or empty name. * * @param name bin name, current limit is 14 characters * @param value bin value */ public Bin(String name, double value) { this.name = name; this.value = Value.get(value); }
/** * Get value from Record object. Useful when copying records from one cluster to another. */ public static Value getFromRecordObject(Object value) { return Value.get(value); }
/** * Constructor, specifying bin name and byte value. * For servers configured as "single-bin", enter a null or empty name. * * @param name bin name, current limit is 14 characters * @param value bin value */ public Bin(String name, byte value) { this.name = name; this.value = Value.get(value); }
/** * Constructor, specifying bin name and integer value. * The server will convert all integers to longs. * For servers configured as "single-bin", enter a null or empty name. * * @param name bin name, current limit is 14 characters * @param value bin value */ public Bin(String name, int value) { this.name = name; this.value = Value.get(value); }
/** * 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. * * @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 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 list increment operation with policy. * Server increments list[index] by 1. * Server returns list[index] after incrementing. */ public static Operation increment(ListPolicy policy, String binName, int index) { return CDT.createOperation(INCREMENT, Operation.Type.CDT_MODIFY, binName, index, Value.get(1), policy.attributes, policy.flags); }
/** * @param next * @return */ public Criteria gte(Object o,String propertyName) { Qualifier qualifier = new Qualifier(propertyName, Qualifier.FilterOperation.GTEQ, Value.get(o)); this.isValue = o; this.criteria.put(Qualifier.FilterOperation.GTEQ.name(), qualifier); return this; }
protected static Operation createOperation(int command, Operation.Type type, String binName) { Packer packer = new Packer(); packer.packRawShort(command); return new Operation(type, binName, Value.get(packer.toByteArray())); }
/** * Create default list append items operation. * Server appends each input list item to end of list bin. * Server returns list size. */ public static Operation appendItems(String binName, List<Value> list) { Packer packer = new Packer(); packer.packRawShort(APPEND_ITEMS); packer.packArrayBegin(1); packer.packValueList(list); return new Operation(Operation.Type.CDT_MODIFY, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, Value v2, int v3) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(3); packer.packInt(v1); v2.pack(packer); packer.packInt(v3); return new Operation(type, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, int v2, int v3) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(3); packer.packInt(v1); packer.packInt(v2); packer.packInt(v3); return new Operation(type, binName, Value.get(packer.toByteArray())); }
protected static Operation createOperation(int command, Operation.Type type, String binName, int v1, Value v2, int v3, int v4) { Packer packer = new Packer(); packer.packRawShort(command); packer.packArrayBegin(4); packer.packInt(v1); v2.pack(packer); packer.packInt(v3); packer.packInt(v4); return new Operation(type, binName, Value.get(packer.toByteArray())); }