Jutil aggregates code for utility commonly used in Java development, including text processing, date processing, common model definitions, and more, eliminating common code in multiple projects.
- Commonly used text, number, date, time, collection, and more processing.
- The commonly used result model is defined, see CommonResult.
- A good error code and exception management mode, see CommonAssertUtil.
- A lightweight implementation of validating fields with annotations, see FieldConstraintValidator.
- Obtain hardware resource information about the host, see DiskUtil and MemoryUtil.
-
Add jutil dependency
-
Find the required tool class (either through documentation or through code):
such as StringUtil
-
Use it
- Determine whether the name of the item is empty:
if (StringUtil.isBlank(itemName)) { }
- Determines whether the price is a numeric value, to determine whether the user input is valid
if(!StringUtil.isNumber(price)){ // thr Exception }
This showcase is just one part of jutil features. If you want to learn more, please refer to the documentation.
Jutil is under the Apache 2.0 license. See the Apache License 2.0 file for details.