summaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/acl/iptables/Command.java
blob: 4f487cb66883278baf3b98ec8b9df36635bf1427 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.maintenance.acl.iptables;

/**
 * Represents a single iptables command
 *
 * @author mpolden
 */
public interface Command {

    String asString();

    default String asString(String commandName) {
        return commandName + " "  + asString();
    }

    default String[] asArray(String commandName) {
        return asString(commandName).split(" ");
    }
}