Files
codeCheck/src/main/java/com/codechecker/model/FieldInfo.java
2026-06-09 17:57:52 +08:00

53 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.codechecker.model;
import java.util.Objects;
/**
* 解析后的单个字段名称、类型、业务说明Schema/注释)。
*/
public class FieldInfo {
private final String name;
private final String type;
private final String description;
public FieldInfo(String name, String type, String description) {
this.name = name;
this.type = type;
this.description = description == null ? "" : description;
}
/** 字段名 */
public String getName() {
return name;
}
/** 字段类型(简单名) */
public String getType() {
return type;
}
/** 字段说明文案 */
public String getDescription() {
return description;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof FieldInfo)) {
return false;
}
FieldInfo other = (FieldInfo) o;
return Objects.equals(name, other.name)
&& Objects.equals(type, other.type)
&& Objects.equals(description, other.description);
}
@Override
public int hashCode() {
return Objects.hash(name, type, description);
}
}