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.v3.model.AggBy;

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

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