use of org.apache.geode.pdx.PdxFieldDoesNotExistException in project geode by apache.
the class PdxWriterImpl method markIdentityField.
public PdxWriter markIdentityField(String fieldName) {
if (definingNewPdxType()) {
PdxField ft = this.newType.getPdxField(fieldName);
if (ft == null) {
throw new PdxFieldDoesNotExistException("Field " + fieldName + " must be written before calling markIdentityField");
}
ft.setIdentityField(true);
} else if (doExtraValidation()) {
PdxField ft = this.existingType.getPdxField(fieldName);
if (ft == null) {
throw new PdxFieldDoesNotExistException("Field " + fieldName + " must be written before calling markIdentityField");
} else if (!ft.isIdentityField()) {
throw new PdxSerializationException("Expected field " + fieldName + " to not be marked as an identity field since it was not for the first serialization");
}
}
return this;
}
Aggregations