aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/LineEditor.java
blob: a7dcb4dd32a9a08d2f4265ea5f166bc3f7d6c072 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Vespa.ai. 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();
}