/** * Checks that the specified expression is <code>false</code>. If not an <code>InvalidRequestException</code> will * be thrown. * * @param expression the expression to test * @param message the error message * @throws InvalidRequestException if the specified expression is <code>true</code>. */ public static void checkFalse(boolean expression, String message) throws InvalidRequestException { checkTrue(!expression, message); }
/** * Checks that the specified expression is <code>false</code>. If not an <code>InvalidRequestException</code> will * be thrown. * * @param expression the expression to test * @param message the error message * @throws InvalidRequestException if the specified expression is <code>true</code>. */ public static void checkFalse(boolean expression, String message) throws InvalidRequestException { checkTrue(!expression, message); }
/** * Checks that the specified expression is <code>true</code>. If not an <code>InvalidRequestException</code> will * be thrown. * * @param expression the expression to test * @param message the error message * @throws InvalidRequestException if the specified expression is <code>false</code>. */ public static void checkTrue(boolean expression, String message) throws InvalidRequestException { checkTrue(expression, message, EMPTY_OBJECT_ARRAY); }
/** * Checks that the specified expression is <code>true</code>. If not an <code>InvalidRequestException</code> will * be thrown. * * @param expression the expression to test * @param message the error message * @throws InvalidRequestException if the specified expression is <code>false</code>. */ public static void checkTrue(boolean expression, String message) throws InvalidRequestException { checkTrue(expression, message, EMPTY_OBJECT_ARRAY); }
/** * Checks that the specified expression is <code>false</code>. If not an <code>InvalidRequestException</code> will * be thrown. * * @param expression the expression to test * @param message the error message * @throws InvalidRequestException if the specified expression is <code>true</code>. */ public static void checkFalse(boolean expression, String message) throws InvalidRequestException { checkTrue(!expression, message); }
/** * Checks that the specified expression is <code>false</code>. If not an <code>InvalidRequestException</code> will * be thrown. * * @param expression the expression to test * @param message the error message * @throws InvalidRequestException if the specified expression is <code>true</code>. */ public static void checkFalse(boolean expression, String message) throws InvalidRequestException { checkTrue(!expression, message); }
/** * Checks that the specified expression is <code>true</code>. If not an <code>InvalidRequestException</code> will * be thrown. * * @param expression the expression to test * @param message the error message * @throws InvalidRequestException if the specified expression is <code>false</code>. */ public static void checkTrue(boolean expression, String message) throws InvalidRequestException { checkTrue(expression, message, EMPTY_OBJECT_ARRAY); }
/** * Checks that the specified expression is <code>true</code>. If not an <code>InvalidRequestException</code> will * be thrown. * * @param expression the expression to test * @param message the error message * @throws InvalidRequestException if the specified expression is <code>false</code>. */ public static void checkTrue(boolean expression, String message) throws InvalidRequestException { checkTrue(expression, message, EMPTY_OBJECT_ARRAY); }
/** * Validates that the specified amount is less than the limit. * @param units the number of units to check * @param limit the limit on the number of units * @param unitName the unit name */ private void validate(long units, long limit, String unitName) { checkTrue(units <= limit, "Invalid duration. The total number of %s must be less or equal to %s", unitName, Integer.MAX_VALUE); }
/** * Validates that the specified amount is less than the limit. * @param units the number of units to check * @param limit the limit on the number of units * @param unitName the unit name */ private void validate(long units, long limit, String unitName) { checkTrue(units <= limit, "Invalid duration. The total number of %s must be less or equal to %s", unitName, Integer.MAX_VALUE); }
/** * Validates that the specified amount is less than the limit. * @param units the number of units to check * @param limit the limit on the number of units * @param unitName the unit name */ private void validate(long units, long limit, String unitName) { checkTrue(units <= limit, "Invalid duration. The total number of %s must be less or equal to %s", unitName, Integer.MAX_VALUE); }
/** * Validates that the specified amount is less than the limit. * @param units the number of units to check * @param limit the limit on the number of units * @param unitName the unit name */ private void validate(long units, long limit, String unitName) { checkTrue(units <= limit, "Invalid duration. The total number of %s must be less or equal to %s", unitName, Integer.MAX_VALUE); }
@Override public void addUpdateForKey(PartitionUpdate update, Slice slice, UpdateParameters params) { List<Operation> regularDeletions = getRegularOperations(); List<Operation> staticDeletions = getStaticOperations(); checkTrue(regularDeletions.isEmpty() && staticDeletions.isEmpty(), "Range deletions are not supported for specific columns"); update.add(params.makeRangeTombstone(slice)); }
@Override public void addUpdateForKey(PartitionUpdate update, Slice slice, UpdateParameters params) { List<Operation> regularDeletions = getRegularOperations(); List<Operation> staticDeletions = getStaticOperations(); checkTrue(regularDeletions.isEmpty() && staticDeletions.isEmpty(), "Range deletions are not supported for specific columns"); update.add(params.makeRangeTombstone(slice)); }
@Override public void addUpdateForKey(PartitionUpdate update, Slice slice, UpdateParameters params) { List<Operation> regularDeletions = getRegularOperations(); List<Operation> staticDeletions = getStaticOperations(); checkTrue(regularDeletions.isEmpty() && staticDeletions.isEmpty(), "Range deletions are not supported for specific columns"); update.add(params.makeRangeTombstone(slice)); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isContains(), "Collection column %s can only be restricted by CONTAINS, CONTAINS KEY, or map-entry equality", columnDef.name); SingleColumnRestriction.ContainsRestriction newContains = new ContainsRestriction(columnDef); copyKeysAndValues(this, newContains); copyKeysAndValues((ContainsRestriction) otherRestriction, newContains); return newContains; }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isContains(), "Collection column %s can only be restricted by CONTAINS, CONTAINS KEY, or map-entry equality", columnDef.name); SingleColumnRestriction.ContainsRestriction newContains = new ContainsRestriction(columnDef); copyKeysAndValues(this, newContains); copyKeysAndValues((ContainsRestriction) otherRestriction, newContains); return newContains; }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isContains(), "Collection column %s can only be restricted by CONTAINS, CONTAINS KEY, or map-entry equality", columnDef.name); SingleColumnRestriction.ContainsRestriction newContains = new ContainsRestriction(columnDef); copyKeysAndValues(this, newContains); copyKeysAndValues((ContainsRestriction) otherRestriction, newContains); return newContains; }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isSlice(), "Column \"%s\" cannot be restricted by both an equality and an inequality relation", columnDef.name); SingleColumnRestriction.SliceRestriction otherSlice = (SingleColumnRestriction.SliceRestriction) otherRestriction; checkFalse(hasBound(Bound.START) && otherSlice.hasBound(Bound.START), "More than one restriction was found for the start bound on %s", columnDef.name); checkFalse(hasBound(Bound.END) && otherSlice.hasBound(Bound.END), "More than one restriction was found for the end bound on %s", columnDef.name); return new SliceRestriction(columnDef, slice.merge(otherSlice.slice)); }
@Override public SingleRestriction doMergeWith(SingleRestriction otherRestriction) { checkTrue(otherRestriction.isSlice(), "Column \"%s\" cannot be restricted by both an equality and an inequality relation", columnDef.name); SingleColumnRestriction.SliceRestriction otherSlice = (SingleColumnRestriction.SliceRestriction) otherRestriction; checkFalse(hasBound(Bound.START) && otherSlice.hasBound(Bound.START), "More than one restriction was found for the start bound on %s", columnDef.name); checkFalse(hasBound(Bound.END) && otherSlice.hasBound(Bound.END), "More than one restriction was found for the end bound on %s", columnDef.name); return new SliceRestriction(columnDef, slice.merge(otherSlice.slice)); }