int getFirstIdx(String name) { return getAllIdx(name)[0]; }
protected int[] getAllIndexesOf(String name) { return wrapped.statement.getVariables().getAllIdx(name); }
int getFirstIdx(String name) { return getAllIdx(name)[0]; }
int getFirstIdx(String name) { return getAllIdx(name)[0]; }
int getFirstIdx(String name) { return getAllIdx(name)[0]; }
int getFirstIdx(String name) { return getAllIdx(name)[0]; }
protected int[] getAllIndexesOf(String name) { return wrapped.statement.getVariables().getAllIdx(name); }
protected int[] getAllIndexesOf(String name) { return wrapped.statement.getVariables().getAllIdx(name); }
protected int[] getAllIndexesOf(String name) { return wrapped.statement.getVariables().getAllIdx(name); }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided string. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * of neither of the following types: VARCHAR, TEXT or ASCII. */ public BoundStatement setString(String name, String v) { int[] indexes = metadata().getAllIdx(name); for (int i = 0; i < indexes.length; i++) setString(indexes[i], v); return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided set. * <p> * Please note that {@code null} values are not supported inside collection by CQL. * * @param <T> the type of the elements of the set to set. * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * not a map type or if the elements of {@code v} are not of the type of * the elements of column {@code name}. * @throws NullPointerException if {@code v} contains null values. Nulls are not supported in collections * by CQL. */ public <T> BoundStatement setSet(String name, Set<T> v) { int[] indexes = metadata().getAllIdx(name); for (int i = 0; i < indexes.length; i++) setSet(indexes[i], v); return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided integer. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any one occurrence of) {@code name} is not of type INT. */ public BoundStatement setInt(String name, int v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = TypeCodec.IntCodec.instance.serializeNoBoxing(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.INT); setValue(indexes[i], value); } return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided float. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * not of type FLOAT. */ public BoundStatement setFloat(String name, float v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = TypeCodec.FloatCodec.instance.serializeNoBoxing(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.FLOAT); setValue(indexes[i], value); } return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided boolean. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any one occurrence of) {@code name} is not of type BOOLEAN. */ public BoundStatement setBool(String name, boolean v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = TypeCodec.BooleanCodec.instance.serializeNoBoxing(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.BOOLEAN); setValue(indexes[i], value); } return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided long. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * not of type BIGINT or COUNTER. */ public BoundStatement setLong(String name, long v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = TypeCodec.LongCodec.instance.serializeNoBoxing(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.BIGINT, DataType.Name.COUNTER); setValue(indexes[i], value); } return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided date. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * not of type TIMESTAMP. */ public BoundStatement setDate(String name, Date v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = v == null ? null : TypeCodec.DateCodec.instance.serialize(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.TIMESTAMP); setValue(indexes[i], value); } return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided inet address. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * not of type INET. */ public BoundStatement setInet(String name, InetAddress v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = v == null ? null : TypeCodec.InetCodec.instance.serialize(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.INET); setValue(indexes[i], value); } return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided double. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * not of type DOUBLE. */ public BoundStatement setDouble(String name, double v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = TypeCodec.DoubleCodec.instance.serializeNoBoxing(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.DOUBLE); setValue(indexes[i], value); } return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided big integer. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * not of type VARINT. */ public BoundStatement setVarint(String name, BigInteger v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = v == null ? null : TypeCodec.BigIntegerCodec.instance.serialize(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.VARINT); setValue(indexes[i], value); } return this; }
/** * Sets the value for (all occurrences of) variable {@code name} to the * provided big decimal. * * @param name the name of the variable to set; if multiple variables * {@code name} are prepared, all of them are set. * @param v the value to set. * @return this BoundStatement. * * @throws IllegalArgumentException if {@code name} is not a prepared * variable, that is, if {@code !this.preparedStatement().variables().names().contains(name)}. * @throws InvalidTypeException if (any occurrence of) {@code name} is * not of type DECIMAL. */ public BoundStatement setDecimal(String name, BigDecimal v) { int[] indexes = metadata().getAllIdx(name); ByteBuffer value = v == null ? null : TypeCodec.DecimalCodec.instance.serialize(v); for (int i = 0; i < indexes.length; i++) { metadata().checkType(indexes[i], DataType.Name.DECIMAL); setValue(indexes[i], value); } return this; }