// Autogenerated by metajava.py.
// Do not edit this file directly.
// The template for this file is located at:
// ../../../../../../../../templates/Exception.java
package com.rethinkdb.gen.exc;

import java.util.Optional;
import com.rethinkdb.ast.ReqlAst;
import com.rethinkdb.model.Backtrace;

public class ReqlPermissionError extends ReqlRuntimeError {

    Optional<Backtrace> backtrace = Optional.empty();
    Optional<ReqlAst> term = Optional.empty();

    public ReqlPermissionError() {
    }

    public ReqlPermissionError(String message) {
        super(message);
    }

    public ReqlPermissionError(String format, Object... args) {
        super(String.format(format, args));
    }

    public ReqlPermissionError(String message, Throwable cause) {
        super(message, cause);
    }

    public ReqlPermissionError(Throwable cause) {
        super(cause);
    }

    public ReqlPermissionError(String msg, ReqlAst term, Backtrace bt) {
        super(msg);
        this.backtrace = Optional.ofNullable(bt);
        this.term = Optional.ofNullable(term);
    }

    public ReqlPermissionError setBacktrace(Backtrace backtrace) {
        this.backtrace = Optional.ofNullable(backtrace);
        return this;
    }

    public Optional<Backtrace> getBacktrace() {
        return backtrace;
    }

    public ReqlPermissionError setTerm(ReqlAst term) {
        this.term = Optional.ofNullable(term);
        return this;
    }

    public Optional<ReqlAst> getTerm() {
        return this.term;
    }
}
