All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.xfournet.jconfig.Diff Maven / Gradle / Ivy

There is a newer version: 0.8.0
Show newest version
package io.github.xfournet.jconfig;

import java.util.*;
import javax.annotation.*;

/**
 * Represent a difference between two files.
 */
public class Diff {
    private final boolean m_overwrite;
    @Nullable
    private final String m_encoding;
    private final List m_lines;

    public Diff(boolean overwrite, @Nullable String encoding, List lines) {
        m_overwrite = overwrite;
        m_encoding = encoding;
        m_lines = lines;
    }

    /**
     * @return {@code true} if the original file is completely overwritten by the difference or {@code false} when the difference must be merged into the original file
     */
    public boolean isOverwrite() {
        return m_overwrite;
    }

    /**
     * @return an optional information that indicate how {@link #getLines()} are encoded.
     */
    @Nullable
    public String getEncoding() {
        return m_encoding;
    }

    /**
     * @return the lines that represent the content of the difference
     */
    public List getLines() {
        return m_lines;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy