c3a026c12778766ba265d3b579a1a3343698e839
[openflowplugin.git] / drop-test-karaf / src / main / java / org / opendaylight / openflowplugin / droptestkaraf / DropAllPacketsCompleter.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.openflowplugin.droptestkaraf;
9
10 import java.util.List;
11 import org.apache.karaf.shell.console.Completer;
12 import org.apache.karaf.shell.console.completer.StringsCompleter;
13
14 /**
15  * General dropAllPackets on/off argument completer.
16  */
17 public class DropAllPacketsCompleter implements Completer {
18
19     @Override
20     public int complete(String buffer, int cursor, List<String> candidates) {
21         StringsCompleter delegate = new StringsCompleter();
22         delegate.getStrings().add("on");
23         delegate.getStrings().add("off");
24         return delegate.complete(buffer, cursor, candidates);
25     }
26 }