/** * Validate that current definition can be updated with the new definition * @param newType * @return true if the current definition can be updated with the new definition, else false */ @Override public void validateUpdate(IDataType newType) throws TypeUpdateException { super.validateUpdate(newType); StructType newStructType = (StructType) newType; try { TypeUtils.validateUpdate(fieldMapping, newStructType.fieldMapping); } catch (TypeUpdateException e) { throw new TypeUpdateException(newType, e); } }
/** * Validate that current definition can be updated with the new definition * @param newType * @return true if the current definition can be updated with the new definition, else false */ @Override public void validateUpdate(IDataType newType) throws TypeUpdateException { super.validateUpdate(newType); StructType newStructType = (StructType) newType; try { TypeUtils.validateUpdate(fieldMapping, newStructType.fieldMapping); } catch (TypeUpdateException e) { throw new TypeUpdateException(newType, e); } }
/** * Validate that current definition can be updated with the new definition * @param newType * @return true if the current definition can be updated with the new definition, else false */ @Override public void validateUpdate(IDataType newType) throws TypeUpdateException { super.validateUpdate(newType); HierarchicalType newHierarchicalType = (HierarchicalType) newType; //validate on supertypes if ((newHierarchicalType.superTypes.size() != superTypes.size()) || !newHierarchicalType.superTypes.containsAll(superTypes)) { throw new TypeUpdateException(newType, "New type cannot modify superTypes"); } //validate on fields try { TypeUtils.validateUpdate(fieldMapping, newHierarchicalType.fieldMapping); } catch (TypeUpdateException e) { throw new TypeUpdateException(newType, e); } }
/** * Validate that current definition can be updated with the new definition * @param newType * @return true if the current definition can be updated with the new definition, else false */ @Override public void validateUpdate(IDataType newType) throws TypeUpdateException { super.validateUpdate(newType); HierarchicalType newHierarchicalType = (HierarchicalType) newType; //validate on supertypes if ((newHierarchicalType.superTypes.size() != superTypes.size()) || !newHierarchicalType.superTypes.containsAll(superTypes)) { throw new TypeUpdateException(newType, "New type cannot modify superTypes"); } //validate on fields try { TypeUtils.validateUpdate(fieldMapping, newHierarchicalType.fieldMapping); } catch (TypeUpdateException e) { throw new TypeUpdateException(newType, e); } }