how to construct a apache commons 3.1 Range object

前端 未结 2 592
[愿得一人]
[愿得一人] 2021-01-19 01:28

How can I create a apache commons 3.1 Range object?

The java docs say:

\"An immutable range of objects from a minimum to maximum point in

相关标签:
2条回答
  • 2021-01-19 02:15

    The constructor of Range appears to be private so a static method may be the preferred way of constructing the object.

    For example, it looks like you could use the static method between to construct a Range:

    Range.between(100, 200);
    

    However there are other static methods, it just depends what you need.

    0 讨论(0)
  • 2021-01-19 02:20

    Range is an abstract class. Use IntRange range = new IntRange(100, 200) instead.

    0 讨论(0)
提交回复
热议问题