blob: 2a7c04bc496a8d8d6d891646e0b97f074cfdbe1a [file] [log] [blame]
Jian Lic87b23b2017-04-24 15:28:10 +09001/*
2 * Copyright 2017-present Open Networking Laboratory
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.mapping.cli;
17
18import com.google.common.collect.ImmutableList;
19import org.onosproject.cli.AbstractChoicesCompleter;
20import org.onosproject.mapping.MappingStore.Type;
21
22import java.util.List;
23import java.util.stream.Collectors;
24
25/**
26 * Mapping store type completer.
27 */
28public class MappingStoreTypeCompleter extends AbstractChoicesCompleter {
29
30 private static final List<Type> STORE_TYPES =
31 ImmutableList.of(Type.MAP_CACHE, Type.MAP_DATABASE);
32
33 @Override
34 protected List<String> choices() {
35 return STORE_TYPES.stream().map(type ->
36 type.toString().toLowerCase()).collect(Collectors.toList());
37 }
38}