[660][adas][data-center] 添加节点检测功能,节点状态接口,移除节点超时接口

This commit is contained in:
xinfengkun
2024-08-22 16:27:53 +08:00
parent 7b5adcf470
commit 36584260b3
21 changed files with 362 additions and 306 deletions

View File

@@ -0,0 +1,65 @@
package com.zhjt.mogo.adas.data.bean;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.zhjt.mogo.adas.data.AdasConstants;
import java.util.Objects;
public class NodeStateInfo {
private final AdasConstants.NodeName nodeName; //节点名称
@NonNull
private AdasConstants.NodeState nodeState;//节点主状态 包含:未知;存在;不存在;
@Nullable
private AdasConstants.NodeExistState existState;//节点存在时的状态 null表示未知
public NodeStateInfo(AdasConstants.NodeName nodeName, @NonNull AdasConstants.NodeState nodeState) {
this.nodeName = nodeName;
this.nodeState = nodeState;
}
public AdasConstants.NodeName getNodeName() {
return nodeName;
}
@NonNull
public AdasConstants.NodeState getNodeState() {
return nodeState;
}
public void setNodeState(@NonNull AdasConstants.NodeState nodeState) {
this.nodeState = nodeState;
}
@Nullable
public AdasConstants.NodeExistState getExistState() {
return existState;
}
public void setExistState(@Nullable AdasConstants.NodeExistState existState) {
this.existState = existState;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NodeStateInfo that = (NodeStateInfo) o;
return nodeName == that.nodeName && nodeState == that.nodeState && existState == that.existState;
}
@Override
public int hashCode() {
return Objects.hash(nodeName, nodeState, existState);
}
@Override
public String toString() {
return "NodeStateInfo{" +
"nodeName=" + nodeName +
", nodeState=" + nodeState +
", existState=" + existState +
'}';
}
}