For a NumberRange with step size 1, creates a new NumberRange with the same from and to as this NumberRange but with a step size of stepSize . @param stepSize the desired step size @return a new NumberRange
(T stepSize)
| 241 | * @return a new NumberRange |
| 242 | */ |
| 243 | public <T extends Number & Comparable> NumberRange by(T stepSize) { |
| 244 | if (!Integer.valueOf(1).equals(this.stepSize)) { |
| 245 | throw new IllegalStateException("by only allowed on ranges with original stepSize = 1 but found " + this.stepSize); |
| 246 | } |
| 247 | return new NumberRange(comparableNumber(from), comparableNumber(to), stepSize, inclusiveLeft, inclusiveRight); |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * Casts the supplied comparable to a comparable number. |
nothing calls this directly
no test coverage detected