/** * Constructs range with specified <code>beginning</code> and <code>end</code>. * * @param beginning The beginning of the range. * @param end The end of the range. */ public Range(T beginning, T end) { if (beginning == null) { throw new InvalidRangeBoundsException("Beginning of the range cannot be null."); } if (end == null) { throw new InvalidRangeBoundsException("End of the range cannot be null."); } if (!beginning.getClass().equals(end.getClass())) { throw new InvalidRangeBoundsException("Beginning and end must be of the same type."); } this.beginning = beginning; this.end = end; }
/** * Constructs range with specified <code>beginning</code> and <code>end</code>. * * @param beginning The beginning of the range. * @param end The end of the range. */ public Range(T beginning, T end) { if (beginning == null) { throw new InvalidRangeBoundsException("Beginning of the range cannot be null."); } if (end == null) { throw new InvalidRangeBoundsException("End of the range cannot be null."); } if (!beginning.getClass().equals(end.getClass())) { throw new InvalidRangeBoundsException("Beginning and end must be of the same type."); } this.beginning = beginning; this.end = end; }
/** * Constructs range value with specified <code>range</code>, <code>useEdgeCases</code> and * <code>distribution</code>. * * @param beginning The beginning of the range. * @param end The end of the range. * @param useEdgeCases Indicates whether to create edge cases as first two values or not. * @param distribution Distribution to use for value selection. */ public RangeValueLocalDateTime(LocalDateTime beginning, LocalDateTime end, boolean useEdgeCases, Distribution distribution) { if (beginning == null) { throw new IllegalArgumentException("Beginning cannot be null."); } if (end == null) { throw new IllegalArgumentException("End cannot be null."); } if (!isRangeIncreasing(beginning, end)) { throw new InvalidRangeBoundsException("End of the range must be greater than the beginning of the range."); } if (distribution == null) { throw new IllegalArgumentException("Distribution cannot be null."); } this.beginning = beginning; this.end = end; this.useEdgeCases = useEdgeCases; this.distribution = distribution; }
/** * Constructs range value with specified <code>range</code>, <code>useEdgeCases</code> and * <code>distribution</code>. * * @param beginning The beginning of the range. * @param end The end of the range. * @param useEdgeCases Indicates whether to create edge cases as first two values or not. * @param distribution Distribution to use for value selection. */ public RangeValueLocalDate(LocalDate beginning, LocalDate end, boolean useEdgeCases, Distribution distribution) { if (beginning == null) { throw new IllegalArgumentException("Beginning cannot be null."); } if (end == null) { throw new IllegalArgumentException("End cannot be null."); } if (!isRangeIncreasing(beginning, end)) { throw new InvalidRangeBoundsException("End of the range must be greater than the beginning of the range."); } if (distribution == null) { throw new IllegalArgumentException("Distribution cannot be null."); } this.beginning = beginning; this.end = end; this.useEdgeCases = useEdgeCases; this.distribution = distribution; }
/** * Constructs range value with specified <code>range</code>, <code>useEdgeCases</code> and * <code>distribution</code>. * * @param beginning The beginning of the range. * @param end The end of the range. * @param useEdgeCases Indicates whether to create edge cases as first two values or not. * @param distribution Distribution to use for value selection. */ public RangeValueLocalDateTime(LocalDateTime beginning, LocalDateTime end, boolean useEdgeCases, Distribution distribution) { if (beginning == null) { throw new IllegalArgumentException("Beginning cannot be null."); } if (end == null) { throw new IllegalArgumentException("End cannot be null."); } if (!isRangeIncreasing(beginning, end)) { throw new InvalidRangeBoundsException("End of the range must be greater than the beginning of the range."); } if (distribution == null) { throw new IllegalArgumentException("Distribution cannot be null."); } this.beginning = beginning; this.end = end; this.useEdgeCases = useEdgeCases; this.distribution = distribution; }
/** * Constructs range value with specified <code>range</code>, <code>useEdgeCases</code> and * <code>distribution</code>. * * @param beginning The beginning of the range. * @param end The end of the range. * @param useEdgeCases Indicates whether to create edge cases as first two values or not. * @param distribution Distribution to use for value selection. */ public RangeValueLocalDate(LocalDate beginning, LocalDate end, boolean useEdgeCases, Distribution distribution) { if (beginning == null) { throw new IllegalArgumentException("Beginning cannot be null."); } if (end == null) { throw new IllegalArgumentException("End cannot be null."); } if (!isRangeIncreasing(beginning, end)) { throw new InvalidRangeBoundsException("End of the range must be greater than the beginning of the range."); } if (distribution == null) { throw new IllegalArgumentException("Distribution cannot be null."); } this.beginning = beginning; this.end = end; this.useEdgeCases = useEdgeCases; this.distribution = distribution; }
/** * Constructs range value with specified <code>range</code>, <code>useEdgeCases</code> and * <code>distribution</code>. * * @param range Range. * @param useEdgeCases Indicates whether to create edge cases as first two values or not. * @param distribution Distribution to use for value selection. */ public RangeValue(Range<T> range, boolean useEdgeCases, Distribution distribution) { if (range == null) { throw new IllegalArgumentException("Range cannot be null."); } if (!range.isIncreasing()) { throw new InvalidRangeBoundsException("End of the range must be greater than the beginning of the range."); } if (distribution == null) { throw new IllegalArgumentException("Distribution cannot be null."); } this.beginning = range.getBeginning(); this.end = range.getEnd(); this.useEdgeCases = useEdgeCases; this.distribution = distribution; }
/** * Constructs range value with specified <code>range</code>, <code>useEdgeCases</code> and * <code>distribution</code>. * * @param range Range. * @param useEdgeCases Indicates whether to create edge cases as first two values or not. * @param distribution Distribution to use for value selection. */ public RangeValue(Range<T> range, boolean useEdgeCases, Distribution distribution) { if (range == null) { throw new IllegalArgumentException("Range cannot be null."); } if (!range.isIncreasing()) { throw new InvalidRangeBoundsException("End of the range must be greater than the beginning of the range."); } if (distribution == null) { throw new IllegalArgumentException("Distribution cannot be null."); } this.beginning = range.getBeginning(); this.end = range.getEnd(); this.useEdgeCases = useEdgeCases; this.distribution = distribution; }