| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.net; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import java.nio.ByteBuffer; | 7 import java.nio.ByteBuffer; |
| 8 import java.util.AbstractMap; | 8 import java.util.AbstractMap; |
| 9 import java.util.ArrayList; | 9 import java.util.ArrayList; |
| 10 import java.util.Map; | 10 import java.util.Map; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * Sets the HTTP method for the request. Returns builder to facilitate c
haining. | 78 * Sets the HTTP method for the request. Returns builder to facilitate c
haining. |
| 79 * | 79 * |
| 80 * @param method the method to use for request. Default is 'POST' | 80 * @param method the method to use for request. Default is 'POST' |
| 81 * @return the builder to facilitate chaining | 81 * @return the builder to facilitate chaining |
| 82 */ | 82 */ |
| 83 public Builder setHttpMethod(String method) { | 83 public Builder setHttpMethod(String method) { |
| 84 if (method == null) { | 84 if (method == null) { |
| 85 throw new NullPointerException("Invalid method name."); | 85 throw new NullPointerException("Method is required."); |
| 86 } | 86 } |
| 87 mHttpMethod = method; | 87 mHttpMethod = method; |
| 88 return this; | 88 return this; |
| 89 } | 89 } |
| 90 | 90 |
| 91 /** | 91 /** |
| 92 * Adds a request header. Returns builder to facilitate chaining. | 92 * Adds a request header. Returns builder to facilitate chaining. |
| 93 * | 93 * |
| 94 * @param header the header name | 94 * @param header the header name |
| 95 * @param value the header value | 95 * @param value the header value |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 /** | 347 /** |
| 348 * Returns {@code true} if the stream was successfully started and is now | 348 * Returns {@code true} if the stream was successfully started and is now |
| 349 * done (succeeded, canceled, or failed). | 349 * done (succeeded, canceled, or failed). |
| 350 * | 350 * |
| 351 * @return {@code true} if the stream was successfully started and is now | 351 * @return {@code true} if the stream was successfully started and is now |
| 352 * done (completed, canceled, or failed), otherwise returns {@code f
alse} | 352 * done (completed, canceled, or failed), otherwise returns {@code f
alse} |
| 353 * to indicate stream is not yet started or is in progress. | 353 * to indicate stream is not yet started or is in progress. |
| 354 */ | 354 */ |
| 355 public abstract boolean isDone(); | 355 public abstract boolean isDone(); |
| 356 } | 356 } |
| OLD | NEW |