org.json.simple.JSONObject.equals()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.json.simple.JSONObject.equals()方法的一些代码示例,展示了JSONObject.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.equals()方法的具体详情如下:
包路径:org.json.simple.JSONObject
类名称:JSONObject
方法名:equals

JSONObject.equals介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

private boolean repositoryEquals( RepositoryMeta repo1, RepositoryMeta repo2 ) {
 return repo1.toJSONObject().equals( repo2.toJSONObject() );
}

代码示例来源:origin: apache/metron

@Override
public boolean matches(Object o) {
 Values values = (Values) o;
 String actualKey = (String) values.get(0);
 JSONObject actualMessage = (JSONObject) values.get(1);
 removeTimingFields(actualMessage);
 return expectedKey.equals(actualKey) && expectedMessage.equals(actualMessage);
}

代码示例来源:origin: apache/metron

@Override
 public boolean matches(Object o) {
  Values values = (Values) o;
  JSONObject actual = (JSONObject) values.get(0);
  actual.remove("timestamp");
  expected.remove("timestamp");
  actual.remove("stack");
  expected.remove("stack");
  actual.remove("guid");
  expected.remove("guid");
  return actual.equals(expected);
 }
}

代码示例来源:origin: org.geotools/gt-mbstyle

/** Equality based on wrapped {@link #json}. */
@Override
public boolean equals(Object obj) {
  if (this == obj) return true;
  if (obj == null) return false;
  if (getClass() != obj.getClass()) return false;
  MBLayer other = (MBLayer) obj;
  if (json == null) {
    if (other.json != null) return false;
  } else if (!json.equals(other.json)) return false;
  return true;
}

代码示例来源:origin: stackoverflow.com

if (!(subscriptionResponse.equals(null))||!(subscriptionResponse.equals("")))  {

代码示例来源:origin: stackoverflow.com

JSONArray arr1 = new JSONArray();
JSONArray arr2 = new JSONArray();

arr1.put(1);
arr1.put(2);
arr1.put(3);
arr1.put(4);
arr1.put(5);

arr2.put(2);
arr2.put(1);
arr2.put(3);
arr2.put(5);
arr2.put(4);

JSONObject o1 = arr1.toJSONObject(arr1);
JSONObject o2 = arr2.toJSONObject(arr2);

System.out.println(o1.equals(o2)); //true

代码示例来源:origin: entertailion/Fling

if (activityMessage!=null) {
  JSONObject activityMessageType = (JSONObject) activityMessage.get(TYPE);
  if (activityMessageType.equals(ACTIVITY_TIME_UPDATE)) {
    JSONObject activityMessageTypeState = (JSONObject) activityMessage.get(ACTIVITY_STATE);
    if (activityMessageTypeState.get(RESPONSE_CURRENT_TIME) instanceof Double) {

相关文章