/**
* @param map
* @return Custom Field.
*/
public static final CustomField getCustomField(Map<String, Object> map) {
CustomField customField = null;
if (map != null && map.size() > 0) {
// Sometimes we are working with CFs without ID
customField = new CustomField();
customField.setId(getInteger(map, TestLinkResponseParams.ID.toString()));
customField.setDefaultValue(getString(map, TestLinkResponseParams.DEFAULT_VALUE.toString()));
customField.setDisplayOrder(getInteger(map, TestLinkResponseParams.DISPLAY_ORDER.toString()));
customField.setEnableOnDesign(getBoolean(map, TestLinkResponseParams.ENABLE_ON_DESIGN.toString()));
customField.setEnableOnExecution(getBoolean(map, TestLinkResponseParams.ENABLE_ON_EXECUTION.toString()));
customField.setEnableOnTestPlanDesign(getBoolean(map,
TestLinkResponseParams.ENABLE_ON_TEST_PLAN_DESIGN.toString()));
customField.setLabel(getString(map, TestLinkResponseParams.LABEL.toString()));
customField.setLengthMax(getInteger(map, TestLinkResponseParams.LENGTH_MAX.toString()));
customField.setLengthMin(getInteger(map, TestLinkResponseParams.LENGTH_MIN.toString()));
customField.setLocation(getInteger(map, TestLinkResponseParams.LOCATION.toString()));
customField.setName(getString(map, TestLinkResponseParams.NAME.toString()));
customField.setPossibleValues(getString(map, TestLinkResponseParams.POSSIBLE_VALUES.toString()));
customField.setShowOnDesign(getBoolean(map, TestLinkResponseParams.SHOW_ON_DESIGN.toString()));
customField.setShowOnExecution(getBoolean(map, TestLinkResponseParams.SHOW_ON_EXECUTION.toString()));
customField.setShowOnTestPlanDesign(getBoolean(map,
TestLinkResponseParams.SHOW_ON_TEST_PLAN_DESIGN.toString()));
customField.setType(getInteger(map, TestLinkResponseParams.TYPE.toString()));
customField.setValidRegexp(getString(map, TestLinkResponseParams.VALID_REGEXP.toString()));
customField.setValue(getString(map, TestLinkResponseParams.VALUE.toString()));
}
return customField;
}