Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
54993a65
Commit
54993a65
authored
Apr 10, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
检测时间类型
parent
b16fd61a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
CheckerHelper.java
.../main/java/com/yanzuoguang/util/helper/CheckerHelper.java
+24
-4
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/CheckerHelper.java
View file @
54993a65
...
...
@@ -142,7 +142,7 @@ public final class CheckerHelper {
/**
* 检验IP是否合法
*
* @param paramName
* @param paramName
需要检测的名称
* @param paramVal
* @return
*/
...
...
@@ -158,6 +158,14 @@ public final class CheckerHelper {
return
this
;
}
/**
* 检测是否符合时间类型
*
* @param paramName
* @param paramVal
* @param queryType
* @return
*/
public
CheckerHelper
notDateCheck
(
String
paramName
,
String
paramVal
,
String
queryType
)
{
if
(!
isValid
())
{
return
this
;
...
...
@@ -219,9 +227,10 @@ public final class CheckerHelper {
* @param length
* @return
*/
public
CheckerHelper
paramLengthCheck
(
String
paramName
,
String
paramVal
,
int
length
)
{
if
(!
isValid
())
public
CheckerHelper
checkLength
(
String
paramName
,
String
paramVal
,
int
length
)
{
if
(!
isValid
())
{
return
this
;
}
if
(!
StringHelper
.
isEmpty
(
paramVal
)
&&
length
<
paramVal
.
length
())
{
this
.
checkResult
=
String
.
format
(
PARAM_OVER_MAX_LENGTH
,
paramName
)
+
length
;
this
.
setValid
(
false
);
...
...
@@ -229,6 +238,17 @@ public final class CheckerHelper {
return
this
;
}
/**
* 日期字符串
*
* @param paramName 参数名称
* @param paramVal 参数值
* @return
*/
public
CheckerHelper
checkDate
(
String
paramName
,
String
paramVal
)
{
return
checkDate
(
paramName
,
paramVal
,
StringHelper
.
EMPTY
);
}
/**
* 日期字符串
*
...
...
@@ -237,7 +257,7 @@ public final class CheckerHelper {
* @param formatStr 日期格式
* @return
*/
public
CheckerHelper
paramDateCheck
(
String
paramName
,
String
paramVal
,
String
formatStr
)
{
public
CheckerHelper
checkDate
(
String
paramName
,
String
paramVal
,
String
formatStr
)
{
if
(!
isValid
())
{
return
this
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment