@Override public boolean equals(Object other) { if (other == this) { return true; } if (other == null || !(other instanceof PdxField)) { return false; } PdxField otherVFT = (PdxField)other; if (otherVFT.fieldName == null) { return false; } if (otherVFT.fieldName.equals(this.fieldName) && this.type.equals(otherVFT.type)) { return true; } return false; }
@Override public boolean equals(Object other) { if (other == this) { return true; } if (other == null || !(other instanceof PdxField)) { return false; } PdxField otherVFT = (PdxField)other; if (otherVFT.fieldName == null) { return false; } if (otherVFT.fieldName.equals(this.fieldName) && this.isDeleted() == otherVFT.isDeleted() && this.type.equals(otherVFT.type)) { return true; } return false; }
private boolean checkForMatch(PdxType t) { if (this.fields.size() != t.getFieldCount()) { return false; } Iterator<PdxField> pdxIt = t.getFields().iterator(); for (PdxFieldWrapper f: this.fields) { PdxField pdxF = pdxIt.next(); if (!f.getName().equals(pdxF.getFieldName())) { return false; } if (!FieldType.get(f.getField().getType()).equals(pdxF.getFieldType())) { return false; } } return true; }
private boolean checkForMatch(PdxType t) { if (this.fields.size() != t.getUndeletedFieldCount()) { return false; } Iterator<PdxField> pdxIt = t.getFields().iterator(); for (PdxFieldWrapper f: this.fields) { PdxField pdxF = pdxIt.next(); if (pdxF.isDeleted()) { return false; // If the type has a deleted field then we can't do ordered deserialization because we need to skip over the deleted field's bytes. } if (!f.getName().equals(pdxF.getFieldName())) { return false; } if (!FieldType.get(f.getField().getType()).equals(pdxF.getFieldType())) { return false; } } return true; }
private void updateMetaData(String fieldName, FieldType type, boolean isIdentityField) { beforeFieldWrite(); if (definingNewPdxType()) { PdxField ft = new PdxField(fieldName, this.fieldId, this.vlfCount, type, isIdentityField); this.newType.addField(ft); } else if (doExtraValidation()) { PdxField ft = this.existingType.getPdxField(fieldName); if (ft == null) { throw new PdxSerializationException("Did not expect field " + fieldName + " to be serialized since it was not the first time this class was serialized."); } if (this.fieldId != ft.getFieldIndex()) { throw new PdxSerializationException("Detected that the order in which the fields are serialized changed since the first time this class was serialized."); } if (!ft.getFieldType().equals(type)) { throw new PdxSerializationException("Expected field " + fieldName + " to be of type " + ft.getFieldType() + " not of type " + type); } } }
private void updateMetaData(String fieldName, FieldType type, boolean isIdentityField) { beforeFieldWrite(); if (definingNewPdxType()) { PdxField ft = new PdxField(fieldName, this.fieldId, this.vlfCount, type, isIdentityField); this.newType.addField(ft); } else if (doExtraValidation()) { PdxField ft = this.existingType.getPdxField(fieldName); if (ft == null) { throw new PdxSerializationException("Did not expect field " + fieldName + " to be serialized since it was not the first time this class was serialized."); } if (this.fieldId != ft.getFieldIndex()) { throw new PdxSerializationException("Detected that the order in which the fields are serialized changed since the first time this class was serialized."); } if (!ft.getFieldType().equals(type)) { throw new PdxSerializationException("Expected field " + fieldName + " to be of type " + ft.getFieldType() + " not of type " + type); } } }