forked from plusone/plusone-commons
修改变量名。
parent
d5ee8700d2
commit
3a46e2e60c
|
@ -51,23 +51,23 @@ public class SimpleJdbcTemplate {
|
||||||
|
|
||||||
public static Object[] buildParams(final Object... params) {
|
public static Object[] buildParams(final Object... params) {
|
||||||
return Arrays.stream(params)
|
return Arrays.stream(params)
|
||||||
.map(p -> {
|
.map(param -> {
|
||||||
if (p instanceof Optional) {
|
if (param instanceof Optional) {
|
||||||
return OptionalUtil.orElseNull((Optional<?>) p);
|
return OptionalUtil.orElseNull((Optional<?>) param);
|
||||||
}
|
}
|
||||||
if (p instanceof OptionalInt) {
|
if (param instanceof OptionalInt) {
|
||||||
OptionalInt _p = ((OptionalInt) p);
|
OptionalInt p = ((OptionalInt) param);
|
||||||
return _p.isPresent() ? _p.getAsInt() : null;
|
return p.isPresent() ? p.getAsInt() : null;
|
||||||
}
|
}
|
||||||
if (p instanceof OptionalLong) {
|
if (param instanceof OptionalLong) {
|
||||||
OptionalLong _p = ((OptionalLong) p);
|
OptionalLong p = ((OptionalLong) param);
|
||||||
return _p.isPresent() ? _p.getAsLong() : null;
|
return p.isPresent() ? p.getAsLong() : null;
|
||||||
}
|
}
|
||||||
if (p instanceof OptionalDouble) {
|
if (param instanceof OptionalDouble) {
|
||||||
OptionalDouble _p = ((OptionalDouble) p);
|
OptionalDouble p = ((OptionalDouble) param);
|
||||||
return _p.isPresent() ? _p.getAsDouble() : null;
|
return p.isPresent() ? p.getAsDouble() : null;
|
||||||
}
|
}
|
||||||
return p;
|
return param;
|
||||||
})
|
})
|
||||||
.toArray();
|
.toArray();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue