Example #1
1
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }

    if (obj == null) {
      return false;
    }

    if (getClass() != obj.getClass()) {
      return false;
    }

    InputStreamResource other = (InputStreamResource) obj;

    if (stream == null) {
      if (other.stream != null) {
        return false;
      }
    } else if (!stream.equals(other.stream)) {
      return false;
    }

    return true;
  }
Example #2
1
  @Override
  public boolean equals(final Object o) {
    if (this == o) return true;
    if (!(o instanceof HttpParameter)) return false;

    final HttpParameter that = (HttpParameter) o;

    if (file != null ? !file.equals(that.file) : that.file != null) return false;
    if (fileBody != null ? !fileBody.equals(that.fileBody) : that.fileBody != null) return false;
    if (!name.equals(that.name)) return false;
    if (value != null ? !value.equals(that.value) : that.value != null) return false;

    return true;
  }
Example #3
1
  public JSONObject POST(String url, JSONObject jsonObject)
      throws HttpResultException, HttpException {
    InputStream inputStream = null;
    JSONObject result = new JSONObject();
    try {
      HttpClient httpclient = new DefaultHttpClient();
      HttpPost httpPost = new HttpPost(url);
      StringEntity entity = new StringEntity(jsonObject.toString(), HTTP.UTF_8);
      httpPost.setEntity(entity);
      httpPost.setHeader("Accept", "application/json");
      httpPost.setHeader("Content-type", "application/json;charset=UTF-8");

      HttpResponse httpResponse = httpclient.execute(httpPost);

      int statusCode = httpResponse.getStatusLine().getStatusCode();
      if (statusCode != 200) {
        HttpException httpException =
            new HttpException(statusCode, httpResponse.getStatusLine().getReasonPhrase());
        throw httpException;
      }

      inputStream = httpResponse.getEntity().getContent();
      if (inputStream != null && inputStream.equals("") == false) {
        String responseString = convertInputStreamToString(inputStream);
        result = new JSONObject(responseString);
      } else {
        HttpResultException httpResultException =
            new HttpResultException(HttpResultException.ERRORCODE_JSONNOTFOUND, "");
        throw httpResultException;
      }
    } catch (HttpException he) {
      throw he;
    } catch (HttpResultException hre) {
      throw hre;
    } catch (Exception e) {
      e.printStackTrace();
      Log.d("InputStream", e.getLocalizedMessage());
    }

    return result;
  }
Example #4
1
  @Override
  public boolean equals(final Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    final StatusUpdate that = (StatusUpdate) o;

    if (displayCoordinates != that.displayCoordinates) return false;
    if (inReplyToStatusId != that.inReplyToStatusId) return false;
    if (possiblySensitive != that.possiblySensitive) return false;
    if (location != null ? !location.equals(that.location) : that.location != null) return false;
    if (mediaBody != null ? !mediaBody.equals(that.mediaBody) : that.mediaBody != null)
      return false;
    if (mediaFile != null ? !mediaFile.equals(that.mediaFile) : that.mediaFile != null)
      return false;
    if (mediaName != null ? !mediaName.equals(that.mediaName) : that.mediaName != null)
      return false;
    if (placeId != null ? !placeId.equals(that.placeId) : that.placeId != null) return false;
    if (status != null ? !status.equals(that.status) : that.status != null) return false;

    return true;
  }
 @Override
 public boolean equals(final Object other) {
   return other instanceof SparqlQueryTransform
       && query.equals(((SparqlQueryTransform) other).getQuery());
 }
Example #6
1
 public boolean equals(Object obj) {
   return delegate.equals(obj);
 }
 @Override
 public boolean equals(Object o) {
   return delegate.equals(o);
 }