package com.lanyuanxiaoyao.service.command.provider;

import com.lanyuanxiaoyao.service.command.utils.SearchUtils;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.core.MethodParameter;
import org.springframework.shell.CompletionContext;
import org.springframework.shell.CompletionProposal;

/**
 * @author ZhangJiacheng
 * @date 2022-04-29
 */
public class SearchTypeValueProvider extends BaseValueProvider {
    @Override
    public List<CompletionProposal> complete(MethodParameter parameter, CompletionContext completionContext, String[] hints) {
        return Arrays.stream(SearchUtils.Type.values())
                .map(type -> new CompletionProposal(type.name()))
                .collect(Collectors.toList());
    }
}
