* @param map Map with properties of a Test Project.
* @return Test Project.
*/
@SuppressWarnings("unchecked")
public static final TestProject getTestProject(Map<String, Object> map) {
TestProject testProject = null;
if (map != null && map.size() > 0) {
Object o = map.get(TestLinkResponseParams.ID.toString());
if (o != null) {
Integer id = Integer.parseInt(o.toString());
if (id > 0) {
testProject = new TestProject();
testProject.setId(id);
testProject.setName(getString(map, TestLinkResponseParams.NAME.toString()));
testProject.setPrefix(getString(map, TestLinkResponseParams.PREFIX.toString()));
testProject.setNotes(getString(map, TestLinkResponseParams.NOTES.toString()));
Map<String, Object> optMap = (Map<String, Object>) map.get(TestLinkResponseParams.OPT.toString());
testProject.setEnableAutomation(getBoolean(optMap,
TestLinkResponseParams.AUTOMATION_ENABLED.toString()));
testProject.setEnableRequirements(getBoolean(optMap,
TestLinkResponseParams.REQUIREMENTS_ENABLED.toString()));
testProject.setEnableTestPriority(getBoolean(optMap,
TestLinkResponseParams.TEST_PRIORITY_ENABLED.toString()));
testProject.setEnableInventory(getBoolean(optMap,
TestLinkResponseParams.INVENTORY_ENABLED.toString()));
testProject.setActive(getBoolean(map, TestLinkResponseParams.ACTIVE.toString()));
testProject.setPublic(getBoolean(map, TestLinkResponseParams.IS_PUBLIC.toString()));
}
}
}
return testProject;