blob: bd16068460748d4a64d13fa22fba8652b95a9fd9 [file] [log] [blame]
Charles Chan12a8a842020-02-14 13:23:57 -08001/*
2 * Copyright 2014-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.segmentrouting.cli;
17
18import com.google.common.collect.Lists;
19import org.apache.karaf.shell.api.action.lifecycle.Service;
20import org.onosproject.cli.AbstractChoicesCompleter;
21import org.onosproject.segmentrouting.phasedrecovery.api.Phase;
22
23import java.util.List;
24import java.util.stream.Collectors;
25
26/**
27 * Phase completer.
28 */
29@Service
30public class PhaseCompleter extends AbstractChoicesCompleter {
31 @Override
32 protected List<String> choices() {
33 return Lists.newArrayList(Phase.values()).stream().map(Enum::toString).collect(Collectors.toList());
34 }
35}