package io.delphiplatform.api.config;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import javax.annotation.Nullable;

import io.delphiplatform.api.v2.model.GroupBy;

/**
 * Get the GroupBy enum from a (lowercase) string parameter
 */
public class GroupByEnumConverter implements Converter<String, GroupBy> {

    @Override
    public GroupBy convert(@Nullable String source) {
        return GroupBy.fromValue(source);
    }
}