/** Returns true if two fields are equal, ignoring name and description. */ public boolean typesEqual(Field other) { return getType().typesEqual(other.getType()) && Objects.equals(getNullable(), other.getNullable()); }
/** Returns true if two FieldTypes are equal. */ public boolean typesEqual(FieldType other) { if (!Objects.equals(getTypeName(), other.getTypeName())) { return false; } if (!Arrays.equals(getMetadata(), other.getMetadata())) { return false; } if (getTypeName() == TypeName.ARRAY && !getCollectionElementType().typesEqual(other.getCollectionElementType())) { return false; } if (getTypeName() == TypeName.MAP && (!getMapValueType().typesEqual(other.getMapValueType()) || !getMapKeyType().typesEqual(other.getMapKeyType()))) { return false; } if (getTypeName() == TypeName.ROW && !getRowSchema().typesEqual(other.getRowSchema())) { return false; } return true; }