Skip to content
Snippets Groups Projects
Commit 4996d812 authored by Lars Johansson's avatar Lars Johansson
Browse files

Remove unused code for comparison of beans.element and repository.model objects

parent 7ebb4f0d
No related branches found
No related tags found
No related merge requests found
...@@ -25,8 +25,6 @@ import java.util.UUID; ...@@ -25,8 +25,6 @@ import java.util.UUID;
import org.openepics.names.repository.model.DeviceGroup; import org.openepics.names.repository.model.DeviceGroup;
import org.openepics.names.repository.model.DeviceType; import org.openepics.names.repository.model.DeviceType;
import org.openepics.names.repository.model.Discipline; import org.openepics.names.repository.model.Discipline;
import org.openepics.names.repository.model.NameStructure;
import org.openepics.names.repository.model.Structure;
import org.openepics.names.repository.model.Subsystem; import org.openepics.names.repository.model.Subsystem;
import org.openepics.names.repository.model.System; import org.openepics.names.repository.model.System;
import org.openepics.names.repository.model.SystemGroup; import org.openepics.names.repository.model.SystemGroup;
...@@ -627,194 +625,6 @@ public class StructureElementUtil { ...@@ -627,194 +625,6 @@ public class StructureElementUtil {
when, who); when, who);
} }
private static boolean hasSameContent(StructureElement structureElement, NameStructure nameStructure) {
// StructureElement
// x uuid
// x description
// x status
// x latest
// x deleted
// NameStructure
// x uuid
// x description
// x status
// x latest
// x deleted
if (structureElement == null && nameStructure == null)
return true;
if (structureElement == null)
return false;
if (nameStructure == null)
return false;
if (structureElement.getUuid() == null) {
if (nameStructure.getUuid() != null)
return false;
} else if (!structureElement.getUuid().equals(nameStructure.getUuid()))
return false;
if (structureElement.getDescription() == null) {
if (nameStructure.getDescription() != null)
return false;
} else if (!structureElement.getDescription().equals(nameStructure.getDescription()))
return false;
if (structureElement.getStatus() == null) {
if (nameStructure.getStatus() != null)
return false;
} else if (!structureElement.getStatus().equals(nameStructure.getStatus()))
return false;
if (structureElement.isLatest() == null) {
if (nameStructure.isLatest() != null)
return false;
} else if (!structureElement.isLatest().equals(nameStructure.isLatest()))
return false;
if (structureElement.isDeleted() == null) {
if (nameStructure.isDeleted() != null)
return false;
} else if (!structureElement.isDeleted().equals(nameStructure.isDeleted()))
return false;
return true;
}
private static boolean hasSameContent(StructureElement structureElement, Structure structure) {
// StructureElement
// x name
// x mnemonic
// Structure
// x name
// x mnemonic
if (!hasSameContent(structureElement, (NameStructure) structure))
return false;
if (structureElement == null)
return false;
if (structureElement.getName() == null) {
if (structure.getName() != null)
return false;
} else if (!structureElement.getName().equals(structure.getName()))
return false;
if (structureElement.getMnemonic() == null) {
if (structure.getMnemonic() != null)
return false;
} else if (!structureElement.getMnemonic().equals(structure.getMnemonic()))
return false;
return true;
}
public static boolean hasSameContent(StructureElement structureElement, SystemGroup systemGroup) {
// StructureElement
// x type
// SystemGroup
if (!hasSameContent(structureElement, (Structure) systemGroup))
return false;
return Type.SYSTEMGROUP.equals(structureElement.getType());
}
public static boolean hasSameContent(StructureElement structureElement, System system) {
// StructureElement
// x type
// x parent
// System
// x parent_uuid
if (!hasSameContent(structureElement, (Structure) system))
return false;
if (!Type.SYSTEM.equals(structureElement.getType())) {
return false;
}
if (structureElement.getParent() == null) {
if (system.getParentUuid() != null)
return false;
} else if (!structureElement.getParent().equals(system.getParentUuid()))
return false;
return true;
}
public static boolean hasSameContent(StructureElement structureElement, Subsystem subsystem) {
// StructureElement
// x type
// x parent
// Subsystem
// x parent_uuid
if (!hasSameContent(structureElement, (Structure) subsystem))
return false;
if (!Type.SUBSYSTEM.equals(structureElement.getType())) {
return false;
}
if (structureElement.getParent() == null) {
if (subsystem.getParentUuid() != null)
return false;
} else if (!structureElement.getParent().equals(subsystem.getParentUuid()))
return false;
return true;
}
public static boolean hasSameContent(StructureElement structureElement, Discipline discipline) {
// StructureElement
// x type
// Discipline
if (!hasSameContent(structureElement, (Structure) discipline))
return false;
return Type.DISCIPLINE.equals(structureElement.getType());
}
public static boolean hasSameContent(StructureElement structureElement, DeviceGroup deviceGroup) {
// StructureElement
// x type
// x parent
// Subsystem
// x parent_uuid
if (!hasSameContent(structureElement, (Structure) deviceGroup))
return false;
if (!Type.DEVICEGROUP.equals(structureElement.getType())) {
return false;
}
if (structureElement.getParent() == null) {
if (deviceGroup.getParentUuid() != null)
return false;
} else if (!structureElement.getParent().equals(deviceGroup.getParentUuid()))
return false;
return true;
}
public static boolean hasSameContent(StructureElement structureElement, DeviceType deviceType) {
// StructureElement
// x type
// x parent
// DeviceType
// x parent_uuid
if (!hasSameContent(structureElement, (Structure) deviceType))
return false;
if (!Type.DEVICETYPE.equals(structureElement.getType())) {
return false;
}
if (structureElement.getParent() == null) {
if (deviceType.getParentUuid() != null)
return false;
} else if (!structureElement.getParent().equals(deviceType.getParentUuid()))
return false;
return true;
}
// ---------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment