use of org.talend.components.netsuite.client.model.search.SearchFieldOperatorType in project components by Talend.
the class BasicMetaData method getSearchFieldOperator.
/**
* Get search field operator for given search field type and operator name.
*
* @see SearchFieldOperatorType
* @see SearchFieldOperatorName
*
* @param fieldType search field type
* @param operatorName operator name
* @return search field operator
*/
public Object getSearchFieldOperator(SearchFieldType fieldType, String operatorName) {
SearchFieldOperatorName operatorQName = new SearchFieldOperatorName(operatorName);
SearchFieldOperatorType operatorType = SearchFieldType.getOperatorType(fieldType);
if (operatorType != null) {
SearchFieldOperatorTypeDesc def = searchFieldOperatorTypeMap.get(operatorType);
return def.getOperator(operatorName);
}
for (SearchFieldOperatorTypeDesc def : searchFieldOperatorTypeMap.values()) {
if (def.hasOperator(operatorQName)) {
return def.getOperator(operatorName);
}
}
throw new IllegalArgumentException("Unknown search field operator: " + fieldType + ", " + operatorName);
}
Aggregations