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
eef9ad5e
Commit
eef9ad5e
authored
Apr 24, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
parent
cca1b7ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
CheckerHelper.java
.../main/java/com/yanzuoguang/util/helper/CheckerHelper.java
+13
-5
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/CheckerHelper.java
View file @
eef9ad5e
...
...
@@ -47,13 +47,18 @@ public final class CheckerHelper {
public
static
final
String
PARAM_NOT_MIN
=
"param [%s] must be big %d"
;
public
static
final
String
PARAM_NOT_MIN_CH
=
"参数[%s]和必须大于%d"
;
public
static
final
String
PARAM_NOT_MAX
=
"param [%s] must be max %d"
;
public
static
final
String
PARAM_NOT_MAX_CH
=
"param [%s] must be max %d"
;
public
static
final
String
PARAM_NOT_RANGE
=
"param [%s] must be range %d and %d"
;
public
static
final
String
PARAM_NOT_RANGE_CH
=
"参数[%s]请在范围%d至%d内"
;
public
static
final
String
PARAM_NOT_MIN_DOUBLE
=
"param [%s] must be big %f"
;
public
static
final
String
PARAM_NOT_MIN_DOUBLE_CH
=
"参数[%s]和必须大于%f"
;
public
static
final
String
PARAM_NOT_MAX_DOUBLE
=
"param [%s] must be max %f"
;
public
static
final
String
PARAM_NOT_MAX_DOUBLE_CH
=
"param [%s] must be max %f"
;
public
static
final
String
PARAM_NOT_RANGE_DOUBLE
=
"param [%s] must be range %f and %f"
;
public
static
final
String
PARAM_NOT_RANGE_DOUBLE_CH
=
"参数[%s]请在范围%f至%f内"
;
public
static
final
String
DATE_CHECK_TYPE_DAY
=
"day"
;
public
static
final
String
DATE_CHECK_TYPE_DAY_CH
=
"日期"
;
...
...
@@ -76,6 +81,9 @@ public final class CheckerHelper {
.
setEnglishChinese
(
PARAM_NOT_MIN
,
PARAM_NOT_MIN_CH
)
.
setEnglishChinese
(
PARAM_NOT_MAX
,
PARAM_NOT_MAX_CH
)
.
setEnglishChinese
(
PARAM_NOT_RANGE
,
PARAM_NOT_RANGE_CH
)
.
setEnglishChinese
(
PARAM_NOT_MIN_DOUBLE
,
PARAM_NOT_MIN_DOUBLE_CH
)
.
setEnglishChinese
(
PARAM_NOT_MAX_DOUBLE
,
PARAM_NOT_MAX_DOUBLE_CH
)
.
setEnglishChinese
(
PARAM_NOT_RANGE_DOUBLE
,
PARAM_NOT_RANGE_DOUBLE_CH
)
.
setEnglishChinese
(
DATE_CHECK_TYPE_DAY
,
DATE_CHECK_TYPE_DAY_CH
)
.
setEnglishChinese
(
DATE_CHECK_TYPE_MONTH
,
DATE_CHECK_TYPE_MONTH_CH
)
;
...
...
@@ -499,7 +507,7 @@ public final class CheckerHelper {
return
this
;
}
if
(
paramVal
<
min
)
{
this
.
checkResult
=
language
.
format
(
PARAM_NOT_MIN
,
paramName
,
min
);
this
.
checkResult
=
language
.
format
(
PARAM_NOT_MIN
_DOUBLE
,
paramName
,
min
);
this
.
setValid
(
false
);
}
return
this
;
...
...
@@ -518,7 +526,7 @@ public final class CheckerHelper {
return
this
;
}
if
(
paramVal
>
max
)
{
this
.
checkResult
=
language
.
format
(
PARAM_NOT_MAX
,
paramName
,
max
);
this
.
checkResult
=
language
.
format
(
PARAM_NOT_MAX
_DOUBLE
,
paramName
,
max
);
this
.
setValid
(
false
);
}
return
this
;
...
...
@@ -538,7 +546,7 @@ public final class CheckerHelper {
return
this
;
}
if
(
paramVal
>
max
||
paramVal
<
min
)
{
this
.
checkResult
=
language
.
format
(
PARAM_NOT_RANGE
,
paramName
,
min
,
max
);
this
.
checkResult
=
language
.
format
(
PARAM_NOT_RANGE
_DOUBLE
,
paramName
,
min
,
max
);
this
.
setValid
(
false
);
}
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