https://github.com/guobinhit/awesome-tools
Hey buddy, there are some awesome tools.
https://github.com/guobinhit/awesome-tools
List: awesome-tools
datetime pagehelper sequence
Last synced: 3 days ago
JSON representation
Hey buddy, there are some awesome tools.
- Host: GitHub
- URL: https://github.com/guobinhit/awesome-tools
- Owner: guobinhit
- License: apache-2.0
- Created: 2019-10-25T06:19:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-21T22:03:55.000Z (over 2 years ago)
- Last Synced: 2025-11-08T23:02:13.011Z (9 months ago)
- Topics: datetime, pagehelper, sequence
- Language: Java
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# awesome-tools

Some awesome tools.
## INDEX
- [Monitor](#monitor)
- [Sequence](#sequence)
- [Page Info](#page-info)
- [Date Time](#date-time)
## Monitor
Using `MonitorWaterLineCalculator` class, we can calculate monitor water line, for example `TP95` :
```java
// create a calculator with water line 95
MonitorWaterLineCalculator calculator = new MonitorWaterLineCalculator(95);
// call calculate method to calculate value
calculator.calculate(param);
// call getResult method to get calculate result
calculator.getResult();
```
## Sequence
Using `FlowNoGenerator` class, we can get a unique flow sequence, for example :
```java
String uniqueNo = FlowNoGenerator.generate("SC");
```
or
```java
String uniqueNo = FlowNoGenerator.generate("SC", "BIC");
```
as above, `generate` method have two signatures:
- `generate(String sysCode)`
- `generate(String sysCode, String bizCode)`
The first parameter is `sysCode` means system code, the second parameter is `bizCode` means business code.
If we only pass a parameter, it's stand by `sysCode`, and `bizCode` will be set `000` as a default value.
## Page Info
Using `PageHelper` class, we can divide page, for example:
```java
List paramList = new ArrayList();
PageHelper pageHelper = new PageHelper(paramList);
List dividePageResultList = pageHelper.getList();
```
or
```java
List paramList = new ArrayList();
PageHelper pageHelper = new PageHelper(1, 10, paramList);
List dividePageResultList = pageHelper.getList();
```
as above, `PageHelper` class have two construction method :
- `PageHelper(List list)`
- `PageHelper(int pageNum, int pageSize, List list)`
The first construction method will call the second construction method :
- `pageNum` : the number of page
- `pageSize` : the capacity of per page
- `list` : the data list that we want to divide page
If we instance `PageHelper` with the only parameter of `list`, the default value of `pageNum` is `1` and `pageSize` is `10`.
## Date Time Util
Using `ThreadSafeDateUtil` class, we can get thread safe date time method.