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.SubsetParam;

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

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