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 2f228f9f
authored
Apr 18, 2023
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
框架完善
1 parent
97411acd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
33 deletions
rest-archetype-framework/rest-admin-context/src/main/java/com/glsx/plat/context/utils/AssertUtil.java → 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/validator/AssertUtils.java
rest-archetype-framework/rest-admin-context/src/main/java/com/glsx/plat/context/utils/AssertUtil.java
→
rest-archetype-framework/rest-admin-context/src/main/java/com/glsx/plat/context/utils/AssertUtil
s
.java
View file @
2f228f9
package
com
.
glsx
.
plat
.
context
.
utils
;
package
com
.
glsx
.
plat
.
context
.
utils
;
import
com.glsx.plat.exception.ValidateException
;
import
com.glsx.plat.exception.ValidateException
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
java.util.Objects
;
/**
/**
* 断言工具类
* 断言工具类
*/
*/
public
class
AssertUtil
{
public
class
AssertUtil
s
{
public
static
void
isBlank
(
String
str
,
String
message
)
{
public
static
void
isBlank
(
String
str
,
String
message
)
{
if
(
StringUtils
.
isBlank
(
str
))
{
if
(
StringUtils
.
isBlank
(
str
))
{
...
@@ -15,7 +18,13 @@ public class AssertUtil {
...
@@ -15,7 +18,13 @@ public class AssertUtil {
}
}
public
static
void
isNull
(
Object
object
,
String
message
)
{
public
static
void
isNull
(
Object
object
,
String
message
)
{
if
(
object
==
null
)
{
if
(
Objects
.
isNull
(
object
))
{
throw
new
ValidateException
(
message
);
}
}
public
static
void
isEmpty
(
Object
object
,
String
message
)
{
if
(
CollectionUtils
.
sizeIsEmpty
(
object
))
{
throw
new
ValidateException
(
message
);
throw
new
ValidateException
(
message
);
}
}
}
}
...
...
rest-archetype-framework/rest-admin-context/src/main/java/com/glsx/plat/context/utils/validator/AssertUtils.java
deleted
100644 → 0
View file @
97411ac
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有,侵权必究!
*/
package
com
.
glsx
.
plat
.
context
.
utils
.
validator
;
import
com.glsx.plat.exception.ValidateException
;
import
org.apache.commons.lang.StringUtils
;
/**
* 数据校验
*/
public
abstract
class
AssertUtils
{
public
static
void
isBlank
(
String
str
,
String
message
)
{
if
(
StringUtils
.
isBlank
(
str
))
{
throw
new
ValidateException
(
message
);
}
}
public
static
void
isNull
(
Object
object
,
String
message
)
{
if
(
object
==
null
)
{
throw
new
ValidateException
(
message
);
}
}
}
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