/** * Indicates whether a given object is "equal to" this JsonObject. An object is considered equal * if it is also a <code>JsonObject</code> and both objects contain the same members <em>in * the same order</em>. * <p> * If two JsonObjects are equal, they will also produce the same JSON output. * </p> * * @param object * the object to be compared with this JsonObject * @return <tt>true</tt> if the specified object is equal to this JsonObject, <code>false</code> * otherwise */ @Override public boolean equals(Object object) { if (this == object) { return true; } if (object == null) { return false; } if (getClass() != object.getClass()) { return false; } Member other = (Member)object; return name.equals(other.name) && value.equals(other.value); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JsonUnflattener)) return false; return root.equals(((JsonUnflattener) o).root); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JsonUnflattener)) return false; return root.equals(((JsonUnflattener) o).root); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JsonFlattener)) return false; return source.equals(((JsonFlattener) o).source); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JsonFlattener)) return false; return source.equals(((JsonFlattener) o).source); }
@Override public boolean equals( Object obj ) { if( this == obj ) { return true; } if( obj == null ) { return false; } if( getClass() != obj.getClass() ) { return false; } Member other = (Member)obj; return name.equals( other.name ) && value.equals( other.value ); }
/** * Indicates whether a given object is "equal to" this JsonObject. An object is considered equal * if it is also a <code>JsonObject</code> and both objects contain the same members <em>in * the same order</em>. * <p> * If two JsonObjects are equal, they will also produce the same JSON output. * </p> * * @param object * the object to be compared with this JsonObject * @return <tt>true</tt> if the specified object is equal to this JsonObject, <code>false</code> * otherwise */ @Override public boolean equals(Object object) { if (this == object) { return true; } if (object == null) { return false; } if (getClass() != object.getClass()) { return false; } Member other = (Member)object; return name.equals(other.name) && value.equals(other.value); }
/** * Indicates whether a given object is "equal to" this JsonObject. An object is considered equal * if it is also a <code>JsonObject</code> and both objects contain the same members <em>in * the same order</em>. * <p> * If two JsonObjects are equal, they will also produce the same JSON output. * </p> * * @param object * the object to be compared with this JsonObject * @return <tt>true</tt> if the specified object is equal to this JsonObject, <code>false</code> * otherwise */ @Override public boolean equals(Object object) { if (this == object) { return true; } if (object == null) { return false; } if (getClass() != object.getClass()) { return false; } Member other = (Member)object; return name.equals(other.name) && value.equals(other.value); }
private JsonValue findOrCreateJsonObject(JsonValue currentVal, String objKey, Integer aryIdx) { if (objKey != null) { JsonObject jsonObj = currentVal.asObject(); if (jsonObj.get(objKey) == null) { JsonValue obj = Json.object(); jsonObj.add(objKey, obj); return obj; } return jsonObj.get(objKey); } else { // aryIdx != null JsonArray jsonAry = currentVal.asArray(); if (jsonAry.size() <= aryIdx || jsonAry.get(aryIdx).equals(Json.NULL)) { JsonValue obj = Json.object(); assureJsonArraySize(jsonAry, aryIdx); jsonAry.set(aryIdx, obj); return obj; } return jsonAry.get(aryIdx); } }
private JsonValue findOrCreateJsonArray(JsonValue currentVal, String objKey, Integer aryIdx) { if (objKey != null) { JsonObject jsonObj = currentVal.asObject(); if (jsonObj.get(objKey) == null) { JsonValue ary = Json.array(); jsonObj.add(objKey, ary); return ary; } return jsonObj.get(objKey); } else { // aryIdx != null JsonArray jsonAry = currentVal.asArray(); if (jsonAry.size() <= aryIdx || jsonAry.get(aryIdx).equals(Json.NULL)) { JsonValue ary = Json.array(); assureJsonArraySize(jsonAry, aryIdx); jsonAry.set(aryIdx, ary); return ary; } return jsonAry.get(aryIdx); } }
private JsonValue findOrCreateJsonArray(JsonValue currentVal, String objKey, Integer aryIdx) { if (objKey != null) { JsonObject jsonObj = currentVal.asObject(); if (jsonObj.get(objKey) == null) { JsonValue ary = Json.array(); jsonObj.add(objKey, ary); return ary; } return jsonObj.get(objKey); } else { // aryIdx != null JsonArray jsonAry = currentVal.asArray(); if (jsonAry.size() <= aryIdx || jsonAry.get(aryIdx).equals(Json.NULL)) { JsonValue ary = Json.array(); assureJsonArraySize(jsonAry, aryIdx); jsonAry.set(aryIdx, ary); return ary; } return jsonAry.get(aryIdx); } }
private JsonValue findOrCreateJsonObject(JsonValue currentVal, String objKey, Integer aryIdx) { if (objKey != null) { JsonObject jsonObj = currentVal.asObject(); if (jsonObj.get(objKey) == null) { JsonValue obj = Json.object(); jsonObj.add(objKey, obj); return obj; } return jsonObj.get(objKey); } else { // aryIdx != null JsonArray jsonAry = currentVal.asArray(); if (jsonAry.size() <= aryIdx || jsonAry.get(aryIdx).equals(Json.NULL)) { JsonValue obj = Json.object(); assureJsonArraySize(jsonAry, aryIdx); jsonAry.set(aryIdx, obj); return obj; } return jsonAry.get(aryIdx); } }