package com.bolyartech.forge.android.app_unit;

public final class OperationOutcome<RESULT, ERROR> {
    private final boolean mIsSuccessful;
    private final boolean mIsAborted;
    private final RESULT mResult;
    private final ERROR mError;


    public static <RES, ERR> OperationOutcome<RES, ERR> createSuccessOutcome(RES result) {
        return new OperationOutcome<>(true, false, result, null);
    }


    public static <RES, ERR> OperationOutcome<RES, ERR> createErrorOutcome(ERR error) {
        return new OperationOutcome<>(false, false, null, error);
    }


    public static <RES, ERR> OperationOutcome<RES, ERR> createAbortedOutcome() {
        return new OperationOutcome<>(false, true, null, null);
    }


    private OperationOutcome(boolean isSuccessful, boolean isAborted, RESULT result, ERROR error) {
        // we don't check for valid combinations of the parameters because the only way to call this constructor is
        // via static factory methods

        mIsSuccessful = isSuccessful;
        mIsAborted = isAborted;
        mResult = result;
        mError = error;
    }


    public boolean isSuccessful() {
        return mIsSuccessful;
    }


    public boolean isAborted() {
        return mIsAborted;
    }


    public RESULT getResult() {
        return mResult;
    }


    public ERROR getError() {
        return mError;
    }
}

@@ -139,46 +139,8 @@
 ul;%0A
-    private final boolean mIsAborted;%0A
     
@@ -337,23 +337,16 @@
 %3C%3E(true,
- false,
  result,
@@ -497,15 +497,8 @@
 lse,
- false,
  nul
@@ -645,14 +645,8 @@
 lse,
- true,
  nul
@@ -717,27 +717,8 @@
 ful,
- boolean isAborted,
  RES
@@ -941,40 +941,8 @@
 ul;%0A
-        mIsAborted = isAborted;%0A
     
@@ -1073,76 +1073,8 @@
 %7D%0A%0A%0A
-    public boolean isAborted() %7B%0A        return mIsAborted;%0A    %7D%0A%0A%0A
     

removing isAborted