feat: complete reverse engineering, standard Maven structure, detailed code annotations and IoT-M platform architecture
This commit is contained in:
1 parent
e8dc09fb3c
commit
cd6a4c70e7
3045 files changed
+566733
-1
No files matched your search
@@ -0,0 +1,91 @@
|
||||
package com.midm.model.device;
|
||||
|
||||
import com.midm.model.GeneralProfile;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Document
|
||||
public class DeviceGroup extends GeneralProfile implements Comparable {
|
||||
private UUID siteUuid;
|
||||
private UUID parentUuid;
|
||||
private Integer order;
|
||||
@Transient
|
||||
private Integer deviceNumbers;
|
||||
private List children;
|
||||
|
||||
public DeviceGroup() {
|
||||
this.deviceNumbers = 0;
|
||||
}
|
||||
|
||||
public DeviceGroup(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public DeviceGroup(UUID siteUuid, UUID parentUuid, String name) {
|
||||
this.init();
|
||||
this.siteUuid = siteUuid;
|
||||
this.parentUuid = parentUuid;
|
||||
this.setName(name);
|
||||
}
|
||||
|
||||
public UUID getSiteUuid() {
|
||||
return this.siteUuid;
|
||||
}
|
||||
|
||||
public void setSiteUuid(UUID siteUuid) {
|
||||
this.siteUuid = siteUuid;
|
||||
}
|
||||
|
||||
public UUID getParentUuid() {
|
||||
return this.parentUuid;
|
||||
}
|
||||
|
||||
public void setParentUuid(UUID parentUuid) {
|
||||
this.parentUuid = parentUuid;
|
||||
}
|
||||
|
||||
public Integer getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
public void setOrder(Integer order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public Integer getDeviceNumbers() {
|
||||
return this.deviceNumbers;
|
||||
}
|
||||
|
||||
public void setDeviceNumbers(Integer numbers) {
|
||||
this.deviceNumbers = numbers == null ? 0 : numbers;
|
||||
}
|
||||
|
||||
public List getChildren() {
|
||||
return this.children;
|
||||
}
|
||||
|
||||
public void setChildren(List children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public boolean equals(UUID uuid) {
|
||||
return this.uuid != null && this.uuid.equals(uuid);
|
||||
}
|
||||
|
||||
public int compareTo(Object target) {
|
||||
UUID targetUuid = null;
|
||||
if (target instanceof UUID) {
|
||||
targetUuid = (UUID)target;
|
||||
} else if (target instanceof DeviceGroup) {
|
||||
targetUuid = ((DeviceGroup)target).getUuid();
|
||||
}
|
||||
|
||||
if (targetUuid == null) {
|
||||
return this.uuid == null ? 0 : 1;
|
||||
} else {
|
||||
return this.uuid == null ? -1 : this.uuid.compareTo(targetUuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user