Search in sources :

Example 1 with SearchFieldOperatorType

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);
}
Also used : SearchFieldOperatorName(org.talend.components.netsuite.client.model.search.SearchFieldOperatorName) SearchFieldOperatorTypeDesc(org.talend.components.netsuite.client.model.search.SearchFieldOperatorTypeDesc) SearchFieldOperatorType(org.talend.components.netsuite.client.model.search.SearchFieldOperatorType)

Aggregations

SearchFieldOperatorName (org.talend.components.netsuite.client.model.search.SearchFieldOperatorName)1 SearchFieldOperatorType (org.talend.components.netsuite.client.model.search.SearchFieldOperatorType)1 SearchFieldOperatorTypeDesc (org.talend.components.netsuite.client.model.search.SearchFieldOperatorTypeDesc)1