|
|
@@ -22,6 +22,7 @@ import javax.persistence.Table;
|
|
|
import javax.persistence.Transient;
|
|
|
import javax.validation.constraints.NotBlank;
|
|
|
import java.util.Date;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
@Getter
|
|
|
@Setter
|
|
|
@@ -99,6 +100,20 @@ public class DeviceTagEntity extends GenericEntity<String> {
|
|
|
return tag;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean equals(Object o) {
|
|
|
+ if (this == o) return true;
|
|
|
+ if (o == null || getClass() != o.getClass()) return false;
|
|
|
+ DeviceTagEntity that = (DeviceTagEntity) o;
|
|
|
+ return
|
|
|
+ Objects.equals(getDeviceId(), that.getDeviceId()) &&
|
|
|
+ Objects.equals(getKey(), that.getKey());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int hashCode() {
|
|
|
+ return Objects.hash(getDeviceId(), getKey(), getName(), getValue(), getType(), getCreateTime(), getDescription(), isAutoUpdate());
|
|
|
+ }
|
|
|
|
|
|
public static String createTagId(String deviceId, String key) {
|
|
|
return DigestUtils.md5Hex(deviceId + ":" + key);
|