Set the result value and notify about operation completion.

@param result
the result value
421862
public void setResult(R result) {
        try {
            lock.lock();
            this.result = result;
            notifyHaveResult();
        }
        finally {
            lock.unlock();
        }
    }
238884
public MatlabResult addResult(String name, MatlabValue result) {
        checkNotNull(name);
        checkNotNull(result);
        this.results.put(name, result);
        return this;
    }
92314
public void setResult(Result result) throws IllegalArgumentException
  {
    if(null == result)
      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"Result should not be null");        
    m_result = result;
  }
150688
@MainThread
    private void handleEventResult(Event event, EventResult result) {
        if (!activeEvents.contains(event)) {
            Utils.logE(event.getKey(), "Cannot send result of finished event");
            return;
        }

        scheduleResultCallbacks(event, result);
        executeTasks(false);
    }
662397
@Override
    public IPromise<T> then(Runnable result) {
        return then( (r,e) -> result.run() );
    }
716980
def _set_result_from_operation(self):
        """"""
        # This must be done in a lock to prevent the polling thread
        # and main thread from both executing the completion logic
        # at the same time.
        with self._completion_lock:
            # If the operation isn't complete or if the result has already been
            # set, do not call set_result/set_exception again.
            # Note: self._result_set is set to True in set_result and
            # set_exception, in case those methods are invoked directly.
            if not self._operation.done or self._result_set:
                return

            if self._operation.HasField("response"):
                response = protobuf_helpers.from_any_pb(
                    self._result_type, self._operation.response
                )
                self.set_result(response)
            elif self._operation.HasField("error"):
                exception = exceptions.GoogleAPICallError(
                    self._operation.error.message,
                    errors=(self._operation.error,),
                    response=self._operation,
                )
                self.set_exception(exception)
            else:
                exception = exceptions.GoogleAPICallError(
                    "Unexpected state: Long-running operation had neither "
                    "response nor error set."
                )
                self.set_exception(exception)
1288744
@Override
    public void setResultProperties(AbstractWrapperIdPages results) {
        super.setResultProperties(results);
        results.setPage(page);
        results.setTotalPages(totalPages);
        results.setTotalResults(totalResults);
    }
586134
public void requestCompleted (T result)
    {
        _result = result;
        ResultListener<T> list = _list;
        _list = null;

        list.requestCompleted(result);
    }
933688
def set_result(self, result):
        """"""
        result = result.result()[0]
        if self.future is not None:
            if isinstance(result, Exception):
                self.future.set_exception(result)
            else:
                self.future.set_result(result)
            self.future = None
        elif isinstance(result, Exception):
            raise result
927664
@Override
    void setScanResult(final ScanResult scanResult) {
        super.setScanResult(scanResult);
        if (value != null) {
            value.setScanResult(scanResult);
        }
    }
49610
public void onSuccess(T result) {
        try {
            statusLock.lock();
            value = result;
            status = new RequestStatus(RequestStatusCode.OK);
            statusLockChangedCondition.signalAll();
        } catch (Exception e) {
            status = new RequestStatus(RequestStatusCode.ERROR);
            exception = new JoynrRuntimeException(e);
        } finally {
            statusLock.unlock();
        }
    }
1007881
@Override
    public IPromise<T> onResult(Consumer<T> resultHandler) {
        return then( (r,e) -> {
            if ( e == null ) {
                resultHandler.accept((T) r);
            }
        });
    }
37887
protected void success(T result) {
    this.result = result;
    this.completed = true;
    for (Callback<T, E> callback : toBeNotified) {
      callback.success(result);
    }
  }
85063
function setResult( $result )
    {
        $this->Parameters['result'] = $result;
        $http = eZHTTPTool::instance();
        $http->setSessionVariable( 'ContentUploadParameters', $this->Parameters );
    }
1253923
protected boolean setResult(Object result) {
        for (; ; ) {
            Object currentState = this.state;

            if (isDoneState(currentState)) {
                return false;
            }

            if (STATE.compareAndSet(this, currentState, result)) {
                done();
                notifyThreadsWaitingOnGet();
                runAsynchronous((ExecutionCallbackNode) currentState, result);
                break;
            }
        }
        return true;
    }
41359
public void setSuccess(V result) {
        if (this.isCancelled()) {
            this.releaseIfNeed(result);
        }
        if (setSuccess0(result)) {
            notifyListeners();
            return;
        }
        throw new IllegalStateException("complete already: " + this);
    }
1027374
protected function setResult(Api\Result $result)
	{
		$this->total = $result->getTotal();
		$this->offset = 0;
		$this->max = $result->getIssuesCount();
		$this->issues = $result->getIssues();
		$this->startAt++;
	}