blob: 76d67ee68c296b50a558ea06f23c00505c470aad [file] [log] [blame]
Luca Prete83bac342016-12-06 19:42:05 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Luca Prete83bac342016-12-06 19:42:05 -08003 *
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.sdnip.cli.completer;
17
Ray Milkey4efc66f2018-10-10 13:37:42 -070018import org.apache.karaf.shell.api.action.lifecycle.Service;
Luca Prete83bac342016-12-06 19:42:05 -080019import org.onosproject.cli.AbstractChoicesCompleter;
20import org.onosproject.net.EncapsulationType;
21
22import java.util.Arrays;
23import java.util.List;
24import java.util.stream.Collectors;
25
26/**
27 * SDN-IP encapsulation type completer.
28 */
Ray Milkey4efc66f2018-10-10 13:37:42 -070029@Service
Luca Prete83bac342016-12-06 19:42:05 -080030public class SdnIpEncapCompleter extends AbstractChoicesCompleter {
31
32 @Override
33 public List<String> choices() {
34 return Arrays.stream(EncapsulationType.values())
35 .map(Enum::toString)
36 .collect(Collectors.toList());
37 }
38}