build static method

Map<String, dynamic>? build(
  1. SortMode? sortMode,
  2. String? param, {
  3. FilterActionType? filterActionType,
})

Implementation

static Map<String, dynamic>? build(SortMode? sortMode, String? param,
    {FilterActionType? filterActionType}) {
  if (param == null || param.isEmpty || sortMode == SortMode.NONE) {
    return null;
  }
  switch (filterActionType ?? FilterActionType.FILTER_JPA) {
    case FilterActionType.FILTER_SQL:
      return MapBuilder<String, dynamic>(multiKey: true)
          .put(PARAM_SORT, "$param ${nameOf(sortMode)}")
          .build();
    case FilterActionType.FILTER_JPA:
    default:
      return MapBuilder<String, dynamic>(multiKey: true)
          .put(PARAM_SORT, "$param,${nameOf(sortMode)}")
          .build();
  }
}