use of eu.europa.ec.fisheries.schema.exchange.v1.MessageDirection in project UVMS-ExchangeModule-APP by UnionVMS.
the class SearchFieldMapper method getSearchValueForMessageDirection.
private static SearchValue getSearchValueForMessageDirection(ExchangeListCriteriaPair criteria) {
if (!SearchField.MESSAGE_DIRECTION.equals(criteria.getKey()) || criteria.getValue() == null) {
return null;
}
MessageDirection messageDirection = MessageDirection.valueOf(criteria.getValue());
SearchValue searchValue = null;
switch(messageDirection) {
case ALL:
searchValue = null;
break;
case INCOMING:
searchValue = new SearchValue(ExchangeSearchField.TRANSFER_INCOMING, "true");
break;
case OUTGOING:
searchValue = new SearchValue(ExchangeSearchField.TRANSFER_INCOMING, "false");
break;
default:
searchValue = null;
}
return searchValue;
}
Aggregations