mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-09 08:57:17 +08:00
style: 调整代码风格 null == xx => xx == null(更符合大众风格)
This commit is contained in:
@@ -52,7 +52,7 @@ public abstract class AbstractMyBatisInterceptor {
|
||||
* @return 字段列表
|
||||
*/
|
||||
protected List<Field> getEncryptFields(Object obj) {
|
||||
if (null == obj) {
|
||||
if (obj == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return this.getEncryptFields(obj.getClass());
|
||||
@@ -98,7 +98,7 @@ public abstract class AbstractMyBatisInterceptor {
|
||||
String mappedStatementId = mappedStatement.getId();
|
||||
return ENCRYPT_PARAM_CACHE.computeIfAbsent(mappedStatementId, key -> {
|
||||
Method method = this.getMethod(mappedStatementId);
|
||||
if (null == method) {
|
||||
if (method == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, FieldEncrypt> encryptMap = new HashMap<>();
|
||||
@@ -106,7 +106,7 @@ public abstract class AbstractMyBatisInterceptor {
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
Parameter parameter = parameters[i];
|
||||
FieldEncrypt fieldEncrypt = parameter.getAnnotation(FieldEncrypt.class);
|
||||
if (null == fieldEncrypt) {
|
||||
if (fieldEncrypt == null) {
|
||||
continue;
|
||||
}
|
||||
String parameterName = this.getParameterName(parameter);
|
||||
|
@@ -68,7 +68,7 @@ public class JsonMaskSerializer extends JsonSerializer<String> implements Contex
|
||||
@Override
|
||||
public JsonSerializer<?> createContextual(SerializerProvider serializerProvider,
|
||||
BeanProperty beanProperty) throws JsonMappingException {
|
||||
if (null == beanProperty) {
|
||||
if (beanProperty == null) {
|
||||
return serializerProvider.findNullValueSerializer(null);
|
||||
}
|
||||
if (!Objects.equals(beanProperty.getType().getRawClass(), String.class)) {
|
||||
@@ -76,7 +76,7 @@ public class JsonMaskSerializer extends JsonSerializer<String> implements Contex
|
||||
}
|
||||
JsonMask jsonMaskAnnotation = ObjectUtil.defaultIfNull(beanProperty.getAnnotation(JsonMask.class), beanProperty
|
||||
.getContextAnnotation(JsonMask.class));
|
||||
if (null == jsonMaskAnnotation) {
|
||||
if (jsonMaskAnnotation == null) {
|
||||
return serializerProvider.findValueSerializer(beanProperty.getType(), beanProperty);
|
||||
}
|
||||
return new JsonMaskSerializer(jsonMaskAnnotation);
|
||||
|
Reference in New Issue
Block a user