package com.atlassian.bitbucket.mesh.git.file;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class EditFileMetadata {

    private final boolean binary;
    private final String encoding;

    private EditFileMetadata(Builder builder) {
        binary = builder.binary;
        encoding = builder.encoding;
    }

    @Nullable
    public String getEncoding() {
        return encoding;
    }

    public boolean isBinary() {
        return binary;
    }

    public static class Builder {

        private boolean binary;
        private String encoding;

        @Nonnull
        public Builder binary(boolean value) {
            binary = value;
            return this;
        }

        @Nonnull
        public EditFileMetadata build() {
            return new EditFileMetadata(this);
        }

        @Nonnull
        public Builder encoding(@Nullable String value) {
            encoding = value;
            return this;
        }
    }
}
