blob: 7cb2be754f461de6800c7740aea8dfd911433470 [file] [log] [blame]
Yuta HIGUCHI48f4cb72018-03-29 20:30:56 -07001/*
2 * Copyright 2018-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.odtn.cli.impl;
17
18import java.util.Arrays;
19import java.util.List;
20import java.util.stream.Collectors;
21
22
Ray Milkey64a05892018-10-09 15:23:52 -070023import org.apache.karaf.shell.api.action.lifecycle.Service;
Yuta HIGUCHI48f4cb72018-03-29 20:30:56 -070024import org.onosproject.cli.AbstractChoicesCompleter;
25import org.onosproject.odtn.cli.impl.OdtnManualTestCommand.Mode;
26
Ray Milkey64a05892018-10-09 15:23:52 -070027@Service
Yuta HIGUCHI48f4cb72018-03-29 20:30:56 -070028public class ModeCompleter extends AbstractChoicesCompleter {
29
30 @Override
31 protected List<String> choices() {
32 return Arrays.asList(Mode.values())
33 .stream()
34 .map(Enum::name)
35 .collect(Collectors.toList());
36 }
37}