feat: 项目整体命名修改cache-schema-checker
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped
This commit is contained in:
56
src/main/java/com/codechecker/cache/schema/FieldSchema.java
vendored
Normal file
56
src/main/java/com/codechecker/cache/schema/FieldSchema.java
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
package com.codechecker.cache.schema;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 扁平化后的单个字段节点。path 使用点号分隔,数组元素以 {@code []} 标记。
|
||||
* 例如:{@code vo.linkList[].id}。
|
||||
*/
|
||||
public class FieldSchema {
|
||||
|
||||
private final String path;
|
||||
private final JsonType jsonType;
|
||||
private final String javaType;
|
||||
|
||||
public FieldSchema(String path, JsonType jsonType, String javaType) {
|
||||
this.path = path;
|
||||
this.jsonType = jsonType;
|
||||
this.javaType = javaType;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public JsonType getJsonType() {
|
||||
return jsonType;
|
||||
}
|
||||
|
||||
public String getJavaType() {
|
||||
return javaType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (!(o instanceof FieldSchema)) {
|
||||
return false;
|
||||
}
|
||||
FieldSchema that = (FieldSchema) o;
|
||||
return Objects.equals(path, that.path)
|
||||
&& jsonType == that.jsonType
|
||||
&& Objects.equals(javaType, that.javaType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(path, jsonType, javaType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return path + ":" + jsonType + "(" + javaType + ")";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user