update java petstore samples

This commit is contained in:
wing328
2017-11-16 17:09:59 +08:00
parent 17bbb25ce4
commit d04d280d1b
19 changed files with 127 additions and 16 deletions

View File

@@ -56,6 +56,7 @@ public class ApiClient {
protected String basePath = "http://petstore.swagger.io:80/v2";
protected boolean debugging = false;
protected int connectionTimeout = 0;
private int readTimeout = 0;
protected Client httpClient;
protected JSON json;
@@ -302,6 +303,27 @@ public class ApiClient {
return this;
}
/**
* read timeout (in milliseconds).
* @return Read timeout
*/
public int getReadTimeout() {
return readTimeout;
}
/**
* Set the read timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
* {@link Integer#MAX_VALUE}.
* @param readTimeout Read timeout in milliseconds
* @return API client
*/
public ApiClient setReadTimeout(int readTimeout) {
this.readTimeout = readTimeout;
httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
return this;
}
/**
* Get the date format used to parse/format date parameters.
* @return Date format