Add a response to the list

 @param [Kanpachi::Response] response The response to add.
 @return [Hash<Kanpachi::Response>] All the added responses.
 @raise DuplicateResponse If a response is being duplicated.
 @api public
779489
def add(response)
      if @list.key? response.name
        raise DuplicateResponse, "A response named #{response.name} already exists"
      end
      @list[response.name] = response
    end
1020381
public void addResponseProp(String key, String value) {
        if (responseProps == null) {
            responseProps = new HashMap<String, String>(16);
        }
        if (key != null && value != null) {
            responseProps.put(key, value);
        }
    }
1057551
function (response) {
            response = JSON.parse(response).result;
            response.stdout.forEach(function (val, index, array) {
                if (val == answers[index]) {
                    results.push(true);
                } else {
                    results.push(false);
                }
            });
            callback({
                results: results,
                message: response.message,
                time: response.time
            });
        }
1189622
def show
      respond_to do |wants|
        wants.html { presenter }
        wants.json { presenter }
        additional_response_formats(wants)
      end
    end
162325
def add(n)
      n[:name] = "#{n[:name]}(#{n[:attr]})" if n[:attr] && n[:name] != n[:attr]

      @nodes[n[:name]] = RailsApiDoc::Controller::Response::Param.new(n[:name], n[:attr], n[:nested])
    end
516236
def setResponse(self, response):
        
        self.response = response
        self.result = self.response.body

        if isinstance(self.result, remoting.ErrorFault):
            self.result.raiseException()
172
public function addResponse($key, array $response)
    {
        $originalRequest = isset($this->request[$key]) ? $this->request[$key] : null;
        $responseBody = isset($response['body']) ? $response['body'] : null;
        $responseError = isset($response['error']) ? $response['error'] : null;
        $responseMethod = isset($response['method']) ? $response['method'] : null;

        $this->responses[$key] = new Response($originalRequest, $responseBody, $responseError, $responseMethod);
    }
654269
def merge!(response)
      return self if response == self
      if Rack::Response === response
        response = [response.status, response.header, response]
      end
      self.status, self.body = response[0], response[2]
      self.header.merge!(response[1])
      self
    end
109971
def _list_response(self, response):
        
        if type(response) is list:
            return response
        if type(response) is dict:
            return [response]
273999
public void addResponse(RecordResponse response) {
        if (response.getResponseSize() + getResponseSize() > 248) {
            throw new IllegalArgumentException();
        }

        if (records == null) {
            records = new RecordResponse[1];
        }
        else {
            RecordResponse old[] = records;
            records = new RecordResponse[old.length + 1];

            System.arraycopy(old, 0, records, 0, old.length);
        }
        records[records.length - 1] = response;

        setDataLength(getResponseSize());
    }
847404
protected static function _addChainedResponse($response)
    {
        $firstChainedMethodName = key($response);

        if (isset(self::$returnValues[$firstChainedMethodName])) {
            self::$returnValues[$firstChainedMethodName] = array_replace_recursive(
                self::$returnValues[$firstChainedMethodName],
                $response[$firstChainedMethodName]
            );
        } else {
            self::$returnValues[$firstChainedMethodName] = $response[$firstChainedMethodName];
        }
    }
910415
def append_headers(f):
    
    @wraps(f)
    def _response_decorator(*args, **kwargs):
        r = f(*args, **kwargs)
        response = r if isinstance(r, Response) else make_response(r)
        append_all(response)
        return response

    return _response_decorator
624480
public synchronized void sendResponse(BinaryResponse response) {
        if (pending == null) {
            pending = new LinkedList<ByteBuffer>();
        }
        pending.add(response.getBuffer());
    }
117794
def add(resource)
      if @list.key? resource.route
        raise DuplicateResource, "A resource accessible via #{resource.http_verb} #{resource.url} already exists"
      end
      @list[resource.route] = resource
    end
1304572
public void addResponse(RecordResponse response) {
        if (records == null) {
            records = new RecordResponse[1];
        }
        else {
            RecordResponse old[] = records;
            records = new RecordResponse[old.length + 1];

            System.arraycopy(old, 0, records, 0, old.length);
        }
        records[records.length - 1] = response;
    }
753550
public void copyToResponse(HttpServletResponse response, byte[] alteredResponse) throws IOException {
        // character encoding
        if(this.characterEncoding != null) {
            response.setCharacterEncoding(this.characterEncoding);
        }

        // charset
        if(this.charset != null) {
            response.setCharacterEncoding(charset);
        }

        // content type
        if(this.contentType != null) {
            response.setContentType(this.contentType);
        }

        // set the status
        if(this.statusCode > 0) {
            response.setStatus(this.statusCode);
        }

        // set the locale
        if(this.locale != null) {
            response.setLocale(this.locale);
        }

        // copy and add all cookies
        if(this.cookies != null) {
            for(Cookie cookie : this.cookies) {
                response.addCookie(cookie);
            }
        }

        // copy the byte array stream and also set its length
        final OutputStream finalOut = response.getOutputStream();
        if(alteredResponse == null) {
            int length = this.outputStream.getLength();
            response.setContentLength(length);

            // write the entire byte chunk
            this.outputStream.getByteArrayOutputStream().writeTo(finalOut);
        } else {
            response.setContentLength(alteredResponse.length);
            finalOut.write(alteredResponse);
        }

        finalOut.flush();
    }
192696
def _append_request_ids(self, resp):
        
        if isinstance(resp, list):
            # Add list of request_ids if response is of type list.
            for resp_obj in resp:
                self._append_request_id(resp_obj)
        elif resp is not None:
            # Add request_ids if response contains single object.
            self._append_request_id(resp)