@SuppressWarnings("unchecked") public Promise<Result,Progress> resolve(Result result){
  List<DoneCallback<Result>> doneCallbacks;
  List<AlwaysCallback> alwaysCallbacks;
synchronized (this) {
    validateInPendingState();
    mState=STATE_RESOLVED;
    printStateChanged("RESOLVED");
    mResult=result;
    doneCallbacks=mCallbacks.cloneDoneCallbacks();
    alwaysCallbacks=mCallbacks.cloneAlwaysCallbacks();
    clearCallbacks();
  }
  if (doneCallbacks.size() > 0 || alwaysCallbacks.size() > 0) {
    triggerAllDones(doneCallbacks);
    triggerAllAlways(alwaysCallbacks);
  }
  return this;
}

@ SuppressWarnings ( "unchecked" ) public Promise < Result , Progress > resolve ( Result result ) { List < DoneCallback < Result > > doneCallbacks ; List < AlwaysCallback > alwaysCallbacks ; synchronized ( this ) { validateInPendingState ( ) ; mState = STATE_RESOLVED ; printStateChanged ( "RESOLVED" ) ; mResult = result ; doneCallbacks = mCallbacks . cloneDoneCallbacks ( ) ; alwaysCallbacks = mCallbacks . cloneAlwaysCallbacks ( ) ; clearCallbacks ( ) ; } if ( doneCallbacks . size ( ) > 0 || alwaysCallbacks . size ( ) > 0 ) { triggerAllDones ( doneCallbacks ) ; triggerAllAlways ( alwaysCallbacks ) ; } return this ; }
resolves the promise , triggers any done / always callbacks
