代码格式化,实体类重写equals、hashcode方法。
This commit is contained in:
@@ -2,7 +2,11 @@ package com.zdjizhi.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author wlh
|
||||
*/
|
||||
public class DosDetectionThreshold implements Serializable {
|
||||
private String profileId;
|
||||
private String attackType;
|
||||
@@ -27,6 +31,30 @@ public class DosDetectionThreshold implements Serializable {
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DosDetectionThreshold threshold = (DosDetectionThreshold) o;
|
||||
return packetsPerSec == threshold.packetsPerSec &&
|
||||
bitsPerSec == threshold.bitsPerSec &&
|
||||
sessionsPerSec == threshold.sessionsPerSec &&
|
||||
isValid == threshold.isValid &&
|
||||
Objects.equals(profileId, threshold.profileId) &&
|
||||
Objects.equals(attackType, threshold.attackType) &&
|
||||
Objects.equals(serverIpList, threshold.serverIpList) &&
|
||||
Objects.equals(serverIpAddr, threshold.serverIpAddr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(profileId, attackType, serverIpList, serverIpAddr, packetsPerSec, bitsPerSec, sessionsPerSec, isValid);
|
||||
}
|
||||
|
||||
public String getProfileId() {
|
||||
return profileId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user