public ByteBuffer getDefaultBytes() { return getFieldType().getDefaultBytes(); }
@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; }
public FieldType defaultGetFieldType(Field f, Class<?> clazz) { return FieldType.get(f.getType()); }
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; }
public boolean isVariableLengthType() { return !this.type.isFixedWidth(); }
public Object getDefaultValueIfFieldExistsInAnyPdxVersions(String fieldName, String className) throws FieldNotFoundInPdxVersion { PdxType pdxType = GemFireCacheImpl .getForPdx( "PDX registry is unavailable because the Cache has been closed.") .getPdxRegistry().getPdxTypeForField(fieldName, className); if (pdxType == null) { throw new FieldNotFoundInPdxVersion("PdxType with field " + fieldName + " is not found for class " + className); } return pdxType.getPdxField(fieldName).getFieldType().getDefaultValue(); }
public String getTypeIdString() { return getFieldType().toString(); }
@Override public int hashCode() { int hash =1 ; if(fieldName != null) { hash = hash*31 + fieldName.hashCode(); } if(type != null) { hash = hash * 31 + type.hashCode(); } return hash; }
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; }
public boolean isVariableLengthType() { return !this.type.isFixedWidth(); }
public Object getDefaultValueIfFieldExistsInAnyPdxVersions(String fieldName, String className) throws FieldNotFoundInPdxVersion { PdxType pdxType = GemFireCacheImpl .getForPdx( "PDX registry is unavailable because the Cache has been closed.") .getPdxRegistry().getPdxTypeForField(fieldName, className); if (pdxType == null) { throw new FieldNotFoundInPdxVersion("PdxType with field " + fieldName + " is not found for class " + className); } return pdxType.getPdxField(fieldName).getFieldType().getDefaultValue(); }
public String getTypeIdString() { return getFieldType().toString(); }
@Override public int hashCode() { int hash =1 ; if(fieldName != null) { hash = hash*31 + fieldName.hashCode(); } if(type != null) { hash = hash * 31 + type.hashCode(); } return hash; }
public ByteSource getDefaultBytes() { return ByteSourceFactory.create(getFieldType().getDefaultBytes()); }
getOwner().transformFieldValue(f, clazz), getOwner().isIdentityField(f, clazz)); if (ft.isFixedWidth()) { fieldList.add(fw); } else {
@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; }
public FieldType defaultGetFieldType(Field f, Class<?> clazz) { return FieldType.get(f.getType()); }
case ARRAY_OF_BYTE_ARRAYS: { ByteBuffer buffer = ur.getRaw(ft); if (!buffer.equals(ft.getFieldType().getDefaultBytes())) { hashCode = hashCode *31 + buffer.hashCode();