/** * Creates an update that performs a bitwise or between the given long value and the integral value of the field with the given name. * * @param fieldName the field name * @param value the value * @return the update * @mongodb.driver.manual reference/operator/update/bit/ $bit */ public static Bson bitwiseOr(final String fieldName, final long value) { return createBitUpdateDocument(fieldName, "or", value); }
/** * Creates an update that performs a bitwise and between the given integer value and the integral value of the field with the given * name. * * @param fieldName the field name * @param value the value * @return the update */ public static Bson bitwiseAnd(final String fieldName, final int value) { return createBitUpdateDocument(fieldName, "and", value); }
/** * Creates an update that performs a bitwise and between the given long value and the integral value of the field with the given name. * * @param fieldName the field name * @param value the value * @return the update * @mongodb.driver.manual reference/operator/update/bit/ $bit */ public static Bson bitwiseAnd(final String fieldName, final long value) { return createBitUpdateDocument(fieldName, "and", value); }
/** * Creates an update that performs a bitwise or between the given integer value and the integral value of the field with the given * name. * * @param fieldName the field name * @param value the value * @return the update * @mongodb.driver.manual reference/operator/update/bit/ $bit */ public static Bson bitwiseOr(final String fieldName, final int value) { return createBitUpdateDocument(fieldName, "or", value); }
/** * Creates an update that performs a bitwise xor between the given integer value and the integral value of the field with the given * name. * * @param fieldName the field name * @param value the value * @return the update */ public static Bson bitwiseXor(final String fieldName, final int value) { return createBitUpdateDocument(fieldName, "xor", value); }
/** * Creates an update that performs a bitwise xor between the given long value and the integral value of the field with the given name. * * @param fieldName the field name * @param value the value * @return the update */ public static Bson bitwiseXor(final String fieldName, final long value) { return createBitUpdateDocument(fieldName, "xor", value); }
private static Bson createBitUpdateDocument(final String fieldName, final String bitwiseOperator, final long value) { return createBitUpdateDocument(fieldName, bitwiseOperator, new BsonInt64(value)); }
private static Bson createBitUpdateDocument(final String fieldName, final String bitwiseOperator, final int value) { return createBitUpdateDocument(fieldName, bitwiseOperator, new BsonInt32(value)); }
/** * Creates an update that performs a bitwise or between the given integer value and the integral value of the field with the given * name. * * @param fieldName the field name * @param value the value * @return the update * @mongodb.driver.manual reference/operator/update/bit/ $bit */ public static Bson bitwiseOr(final String fieldName, final int value) { return createBitUpdateDocument(fieldName, "or", value); }
/** * Creates an update that performs a bitwise and between the given integer value and the integral value of the field with the given * name. * * @param fieldName the field name * @param value the value * @return the update */ public static Bson bitwiseAnd(final String fieldName, final int value) { return createBitUpdateDocument(fieldName, "and", value); }
/** * Creates an update that performs a bitwise and between the given long value and the integral value of the field with the given name. * * @param fieldName the field name * @param value the value * @return the update * @mongodb.driver.manual reference/operator/update/bit/ $bit */ public static Bson bitwiseAnd(final String fieldName, final long value) { return createBitUpdateDocument(fieldName, "and", value); }
/** * Creates an update that performs a bitwise or between the given long value and the integral value of the field with the given name. * * @param fieldName the field name * @param value the value * @return the update * @mongodb.driver.manual reference/operator/update/bit/ $bit */ public static Bson bitwiseOr(final String fieldName, final long value) { return createBitUpdateDocument(fieldName, "or", value); }
/** * Creates an update that performs a bitwise xor between the given long value and the integral value of the field with the given name. * * @param fieldName the field name * @param value the value * @return the update */ public static Bson bitwiseXor(final String fieldName, final long value) { return createBitUpdateDocument(fieldName, "xor", value); }
/** * Creates an update that performs a bitwise xor between the given integer value and the integral value of the field with the given * name. * * @param fieldName the field name * @param value the value * @return the update */ public static Bson bitwiseXor(final String fieldName, final int value) { return createBitUpdateDocument(fieldName, "xor", value); }
private static Bson createBitUpdateDocument(final String fieldName, final String bitwiseOperator, final int value) { return createBitUpdateDocument(fieldName, bitwiseOperator, new BsonInt32(value)); }
private static Bson createBitUpdateDocument(final String fieldName, final String bitwiseOperator, final long value) { return createBitUpdateDocument(fieldName, bitwiseOperator, new BsonInt64(value)); }