19 lines
493 B
Java
19 lines
493 B
Java
|
package de.towerdefence.server.utils;
|
||
|
|
||
|
import de.towerdefence.server.oas.models.PlayerFilter;
|
||
|
import org.springframework.data.domain.Sort;
|
||
|
import org.springframework.stereotype.Component;
|
||
|
|
||
|
@Component
|
||
|
public class OrderToDirectionMapperService {
|
||
|
|
||
|
public Sort.Direction orderToDirection(PlayerFilter.OrderEnum order) {
|
||
|
|
||
|
if (order == PlayerFilter.OrderEnum.ASCENDING) {
|
||
|
return Sort.Direction.ASC;
|
||
|
} else {
|
||
|
return Sort.Direction.DESC;
|
||
|
}
|
||
|
}
|
||
|
}
|