blob: 51513ae8e34c31409b0d1341ace5c7ec10808fc5 [file] [log] [blame]
Ray Milkey9fdf1ea2014-10-21 09:48:02 -07001package org.onlab.onos.cli.net;
2
3import java.util.List;
4import java.util.SortedSet;
5
6import org.apache.karaf.shell.console.Completer;
7import org.apache.karaf.shell.console.completer.StringsCompleter;
8
9/**
10 * Ethernet type completer.
11 */
12public class EthTypeCompleter implements Completer {
13 @Override
14 public int complete(String buffer, int cursor, List<String> candidates) {
15 // Delegate string completer
16 StringsCompleter delegate = new StringsCompleter();
17 SortedSet<String> strings = delegate.getStrings();
18 strings.add(EthType.ARP.toString());
19 strings.add(EthType.BSN.toString());
20 strings.add(EthType.IPV4.toString());
21 strings.add(EthType.LLDP.toString());
22 strings.add(EthType.RARP.toString());
23
24 // Now let the completer do the work for figuring out what to offer.
25 return delegate.complete(buffer, cursor, candidates);
26 }
27
28}