feat: V1.1 - lombok集成

This commit is contained in:
2026-08-03 14:30:55 +08:00
parent 99aae6dc77
commit 20b86592cb
11 changed files with 82 additions and 772 deletions

View File

@@ -1,8 +1,13 @@
package com.codechecker.cache.detector;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;
/**
* 一个 Redis / MQ value 写入(投递)点的静态描述。
*/
@Data
public class WritePoint {
public static final String CHANNEL_REDIS = "REDIS";
@@ -25,8 +30,13 @@ public class WritePoint {
private double confidence = 1.0;
/** REDIS / ROCKETMQ / KAFKA默认 REDIS 兼容现网 */
@Setter(AccessLevel.NONE)
private String channel = CHANNEL_REDIS;
public void setChannel(String channel) {
this.channel = channel == null || channel.isEmpty() ? CHANNEL_REDIS : channel;
}
/** 稳定标识:用于在 old/new 两个版本间配对同一写入点 */
public String signature() {
return enclosingClass + "#" + enclosingMethod + "|" + normalizeKey();
@@ -41,102 +51,6 @@ public class WritePoint {
return CHANNEL_ROCKETMQ.equals(channel) || CHANNEL_KAFKA.equals(channel);
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public int getLineNumber() {
return lineNumber;
}
public void setLineNumber(int lineNumber) {
this.lineNumber = lineNumber;
}
public String getEnclosingClass() {
return enclosingClass;
}
public void setEnclosingClass(String enclosingClass) {
this.enclosingClass = enclosingClass;
}
public String getEnclosingMethod() {
return enclosingMethod;
}
public void setEnclosingMethod(String enclosingMethod) {
this.enclosingMethod = enclosingMethod;
}
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
public String getKeyExpression() {
return keyExpression;
}
public void setKeyExpression(String keyExpression) {
this.keyExpression = keyExpression;
}
public String getResolvedKeyPattern() {
return resolvedKeyPattern;
}
public void setResolvedKeyPattern(String resolvedKeyPattern) {
this.resolvedKeyPattern = resolvedKeyPattern;
}
public String getValueExpression() {
return valueExpression;
}
public void setValueExpression(String valueExpression) {
this.valueExpression = valueExpression;
}
public String getResolvedValueType() {
return resolvedValueType;
}
public void setResolvedValueType(String resolvedValueType) {
this.resolvedValueType = resolvedValueType;
}
public boolean isRootArray() {
return rootArray;
}
public void setRootArray(boolean rootArray) {
this.rootArray = rootArray;
}
public double getConfidence() {
return confidence;
}
public void setConfidence(double confidence) {
this.confidence = confidence;
}
public String getChannel() {
return channel;
}
public void setChannel(String channel) {
this.channel = channel == null || channel.isEmpty() ? CHANNEL_REDIS : channel;
}
/**
* @return 展示用写入位置,形如 {@code SimpleClass#method:line}
*/