// Auto-generated by BoltFFI. Do not edit.
package {{ package_name }};

public final class BoltFFIResult<Ok, Err> {
    private final Ok okValue;
    private final Err errValue;
    private final boolean ok;

    private BoltFFIResult(Ok okValue, Err errValue, boolean ok) {
        this.okValue = okValue;
        this.errValue = errValue;
        this.ok = ok;
    }

    public static <Ok, Err> BoltFFIResult<Ok, Err> ok(Ok value) {
        return new BoltFFIResult<>(value, null, true);
    }

    public static <Ok, Err> BoltFFIResult<Ok, Err> err(Err value) {
        return new BoltFFIResult<>(null, value, false);
    }

    public boolean isOk() {
        return ok;
    }

    public Ok okValue() {
        return okValue;
    }

    public Err errValue() {
        return errValue;
    }
}
