use of org.talend.components.netsuite.client.model.search.SearchFieldOperatorTypeDesc in project components by Talend.
the class BasicMetaData method bindSearchFieldOperatorTypes.
/**
* Bind search operator type descriptors.
*
* @param searchFieldOperatorTypes search operator type descriptors to be registered and bound
*/
protected void bindSearchFieldOperatorTypes(Collection<SearchFieldOperatorTypeDesc> searchFieldOperatorTypes) {
Collection<SearchFieldOperatorTypeDesc> searchFieldOperatorTypeList = new ArrayList<>();
for (SearchFieldOperatorTypeDesc operatorTypeDesc : searchFieldOperatorTypes) {
searchFieldOperatorTypeList.add(operatorTypeDesc);
}
searchFieldOperatorTypeList.add(// Boolean (Synthetic)
new SearchFieldOperatorTypeDesc(SearchFieldOperatorType.BOOLEAN, SearchFieldOperatorType.SearchBooleanFieldOperator.class, null, null));
for (SearchFieldOperatorTypeDesc info : searchFieldOperatorTypeList) {
searchFieldOperatorTypeMap.put(info.getOperatorType(), info);
}
}
use of org.talend.components.netsuite.client.model.search.SearchFieldOperatorTypeDesc 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