* @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.automationEnabled.toString()));
testProject.setEnableRequirements( getBoolean(optMap, TestLinkResponseParams.requirementsEnabled.toString()));
testProject.setEnableTestPriority( getBoolean(optMap, TestLinkResponseParams.testPriorityEnabled.toString()));
testProject.setEnableInventory( getBoolean(optMap, TestLinkResponseParams.inventoryEnabled.toString()));
testProject.setActive( getBoolean(map, TestLinkResponseParams.active.toString()));
testProject.setPublic( getBoolean(map, TestLinkResponseParams.isPublic.toString()));
}
}
}
return testProject;