private boolean inSizeRange(T items) { return sizeRange == null || (items.size() >= sizeRange.min() && items.size() <= sizeRange.max()); }
private boolean inLengthRange(Object items) { int length = Array.getLength(items); return lengthRange == null || (length >= lengthRange.min() && length <= lengthRange.max()); }
private boolean inSizeRange(T target) { return sizeRange == null || (target.size() >= sizeRange.min() && target.size() <= sizeRange.max()); }
/** * Tells this generator to produce values with a length within a specified * minimum and/or maximum, inclusive, chosen with uniform distribution. * * @param size annotation that gives the length constraints */ public void configure(Size size) { this.lengthRange = size; checkRange(INTEGRAL, size.min(), size.max()); }
/** * <p>Tells this generator to add elements to the generated collection * a number of times within a specified minimum and/or maximum, inclusive, * chosen with uniform distribution.</p> * * <p>Note that some kinds of collections disallow duplicates, so the * number of elements added may not be equal to the collection's * {@link Collection#size()}.</p> * * @param size annotation that gives the size constraints */ public void configure(Size size) { this.sizeRange = size; checkRange(INTEGRAL, size.min(), size.max()); }
/** * <p>Tells this generator to add key-value pairs to the generated map a * number of times within a specified minimum and/or maximum, inclusive, * chosen with uniform distribution.</p> * * <p>Note that maps disallow duplicate keys, so the number of pairs added * may not be equal to the map's {@link Map#size()}.</p> * * @param size annotation that gives the size constraints */ public void configure(Size size) { this.sizeRange = size; checkRange(INTEGRAL, size.min(), size.max()); }
private int size(SourceOfRandomness random, GenerationStatus status) { return sizeRange != null ? random.nextInt(sizeRange.min(), sizeRange.max()) : status.size(); }
private int size(SourceOfRandomness random, GenerationStatus status) { return sizeRange != null ? random.nextInt(sizeRange.min(), sizeRange.max()) : status.size(); }
private int length(SourceOfRandomness random, GenerationStatus status) { return lengthRange != null ? random.nextInt(lengthRange.min(), lengthRange.max()) : status.size(); }
private boolean inLengthRange(Object items) { int length = Array.getLength(items); return lengthRange == null || (length >= lengthRange.min() && length <= lengthRange.max()); }
private boolean inSizeRange(T target) { return sizeRange == null || (target.size() >= sizeRange.min() && target.size() <= sizeRange.max()); }
/** * Tells this generator to produce values with a length within a specified * minimum and/or maximum, inclusive, chosen with uniform distribution. * * @param size annotation that gives the length constraints */ public void configure(Size size) { this.lengthRange = size; checkRange(INTEGRAL, size.min(), size.max()); }
public void configure(Size size) { this.sizeRange = size; checkRange(INTEGRAL, size.min(), size.max()); }
public void configure(Size size) { this.sizeRange = size; checkRange(INTEGRAL, size.min(), size.max()); }
private boolean inSizeRange(T items) { return sizeRange == null || (items.size() >= sizeRange.min() && items.size() <= sizeRange.max()); }
private int size(SourceOfRandomness random, GenerationStatus status) { return sizeRange != null ? random.nextInt(sizeRange.min(), sizeRange.max()) : status.size(); }
private int length(SourceOfRandomness random, GenerationStatus status) { return lengthRange != null ? random.nextInt(lengthRange.min(), lengthRange.max()) : status.size(); }
protected final int size(SourceOfRandomness random, GenerationStatus status) { return sizeRange != null ? random.nextInt(sizeRange.min(), sizeRange.max()) : status.size(); }
private int size(SourceOfRandomness random, GenerationStatus status) { return sizeRange != null ? random.nextInt(sizeRange.min(), sizeRange.max()) : status.size(); }
private boolean inSizeRange(T items) { return sizeRange == null || (items.size() >= sizeRange.min() && items.size() <= sizeRange.max()); }