Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
architecture
/
glsx-archetype
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8451c5a0
authored
Apr 18, 2023
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
框架完善
1 parent
2f228f9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
rest-archetype-framework/rest-admin-context/src/main/java/com/glsx/plat/context/utils/AssertUtils.java
rest-archetype-framework/rest-admin-context/src/main/java/com/glsx/plat/context/utils/AssertUtils.java
View file @
8451c5a
package
com
.
glsx
.
plat
.
context
.
utils
;
import
cn.hutool.core.lang.Assert
;
import
com.glsx.plat.exception.ValidateException
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
java.text.MessageFormat
;
import
java.util.Objects
;
/**
* 断言工具类
*/
public
class
AssertUtils
{
public
class
AssertUtils
extends
Assert
{
public
static
void
isBlank
(
String
str
,
String
message
)
{
public
static
void
isBlank
(
String
str
,
String
message
,
Object
...
params
)
{
if
(
StringUtils
.
isBlank
(
str
))
{
throw
new
ValidateException
(
message
);
throw
new
ValidateException
(
MessageFormat
.
format
(
message
,
params
)
);
}
}
public
static
void
isNull
(
Object
object
,
String
message
)
{
public
static
void
isNull
(
Object
object
,
String
message
,
Object
...
params
)
{
if
(
Objects
.
isNull
(
object
))
{
throw
new
ValidateException
(
message
);
throw
new
ValidateException
(
MessageFormat
.
format
(
message
,
params
)
);
}
}
public
static
void
isEmpty
(
Object
object
,
String
message
)
{
public
static
void
isEmpty
(
Object
object
,
String
message
,
Object
...
params
)
{
if
(
CollectionUtils
.
sizeIsEmpty
(
object
))
{
throw
new
ValidateException
(
message
);
throw
new
ValidateException
(
MessageFormat
.
format
(
message
,
params
)
);
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment