public String getQualifiedName() { String fullClassName; if (!TextUtils.isEmpty(packName)) { fullClassName = packName + "." + className; } else { fullClassName = className; } return fullClassName; }
@Override public T handleResponse(String requestBody, HttpEntity entity) throws IOException { String json = EntityUtils.toString(entity, "UTF-8"); com.google.gson.Gson gson = new com.google.gson.Gson(); T response = gson.fromJson(json, clazz); return response; } }
@Override public void close() { // Release underlying connection back to the connection manager try { try { // Attempt to keep connection alive by consuming its remaining content EntityUtils.consume(this.httpResponse.getEntity()); } finally { if (this.httpResponse instanceof Closeable) { ((Closeable) this.httpResponse).close(); } } } catch (IOException ex) { // Ignore exception on close... } }
public void append(final CharArrayBuffer b, int off, int len) { if (b == null) { return; } append(b.buffer, off, len); }
@Override public boolean equals(Object o) { if (o == null) return false; if (this == o) return true; if (o instanceof BasicUserPrincipal) { BasicUserPrincipal that = (BasicUserPrincipal) o; if (LangUtils.equals(this.username, that.username)) { return true; } } return false; }
public void append(char ch) { int newlen = this.len + 1; if (newlen > this.buffer.length) { expand(newlen); } this.buffer[this.len] = ch; this.len = newlen; }
public void append(int b) { int newlen = this.len + 1; if (newlen > this.buffer.length) { expand(newlen); } this.buffer[this.len] = (byte)b; this.len = newlen; }
/** * Creates a new HttpException with the specified detail message and cause. * * @param message the exception detail message * @param cause the <tt>Throwable</tt> that caused this exception, or <tt>null</tt> * if the cause is unavailable, unknown, or not a <tt>Throwable</tt> */ public HttpException(final String message, final Throwable cause) { super(message); ExceptionUtils.initCause(this, cause); }
public void setFieldName(String fieldName) { if (TextUtils.isEmpty(fieldName)) { return; } this.fieldName = fieldName; }
@Override public boolean equals(Object o) { if (o == null) return false; if (this == o) return true; if (o instanceof UsernamePasswordCredentials) { UsernamePasswordCredentials that = (UsernamePasswordCredentials) o; if (LangUtils.equals(this.principal, that.principal)) { return true; } } return false; }
public void ensureCapacity(int required) { int available = this.buffer.length - this.len; if (required > available) { expand(this.len + required); } }
@Override public int hashCode() { int hash = LangUtils.HASH_SEED; hash = LangUtils.hashCode(hash, this.username); return hash; }