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

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

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