aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/LineEditor.java
blob: 30453ac94bc7baf576e1d75a5519fbf6067b8939 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.task.util.file;

import java.util.List;

/**
 * @author hakonhall
 */
public interface LineEditor {
    /**
     * @param line The line of a file.
     * @return The edited line, or empty if the line should be removed.
     */
    LineEdit edit(String line);

    /**
     * Called after edit() has been called on all lines in the file.
     * @return Lines to append to the file.
     */
    List<String> onComplete();
}