private boolean havingAdditionalFields(final TableSchema tableSchema) {
   for (final Field field : tableSchema.getFields()) {
     if (field.getName() == null) {
       return true;
     }
   }
   return false;
 }
    public boolean validate(final Field column, final long lineNumber, final String value) {
      errorArgs = new String[] {lineNumber + "", column.getName(), value};

      // ignore a null value if this is the case
      if ((column.getType() == DataType.SCTID_OR_UUID) && isBlank(value)) return true;

      for (final Pattern pattern : patterns) {
        if (pattern.matcher(value).matches()) {
          return true;
        }
      }
      validationLog.assertionError(errorMessage, lineNumber, column.getName(), value);
      return false;
    }
 @Override
 public boolean validate(final Field column, final long lineNumber, final String value) {
   // Date Stamp
   if (!DATE_PATTERN.matcher(value).matches()) {
     errorArgs = new String[] {lineNumber + "", column.getName(), value};
     return false;
   }
   return true;
 }
 private ColumnType getColumnType(final Field field) {
   switch (field.getType()) {
     case SCTID:
       return ColumnType.SCTID;
     case SCTID_OR_UUID:
       return ColumnType.REL_SCTID;
     case UUID:
       return field.isMandatory() ? ColumnType.UUID : ColumnType.REL_UUID;
     case TIME:
       return field.isMandatory() ? ColumnType.TIME : ColumnType.REL_TIME;
     case BOOLEAN:
       return ColumnType.BOOLEAN;
     case INTEGER:
       return ColumnType.INTEGER;
     case STRING:
       return ColumnType.STRING;
   }
   return null;
 }
 private void testHeaderValue(
     final String value,
     final Field column,
     final Date startTime,
     final String fileName,
     final int colIndex) {
   final String expectedColumnName = column.getName();
   if (expectedColumnName == null) {
     validationLog.info(
         "Column name in the {} file is expected to be null actual '{}' at column {}",
         fileName,
         value,
         colIndex + 1);
     column.setName(value);
   } else if (!expectedColumnName.equalsIgnoreCase(value)) {
     validationLog.assertionError(
         "Column name does not match expected value: expected '{}', actual '{}'",
         expectedColumnName,
         value);
     testReport.addError(
         "1-" + colIndex,
         startTime,
         fileName,
         resourceManager.getFilePath(),
         expectedColumnName,
         COLUMN_HEADING_TEST,
         "",
         value,
         expectedColumnName);
   } else {
     testReport.addSuccess(
         "1-" + colIndex,
         startTime,
         fileName,
         resourceManager.getFilePath(),
         expectedColumnName,
         COLUMN_HEADING_TEST,
         "");
   }
 }
  private void testDataValue(
      final String id,
      final long lineNumber,
      final String value,
      final Field column,
      final Date startTime,
      final String fileName,
      final boolean isReleaseInputFile) {

    final ColumnType columnType = getColumnType(column);

    final PatternTest columnTest = columnTests.get(columnType);

    if (columnTest != null) {
      if (canBeBlank(value, column) || columnTest.validate(column, lineNumber, value)) {
        testReport.addSuccess(
            id,
            startTime,
            fileName,
            resourceManager.getFilePath(),
            column.getName(),
            columnTest.getTestType(),
            columnTest.getPatternString());
      } else {
        final String testedValue = StringUtils.isNoneEmpty(value) ? value : "No Value";
        validationLog.assertionError(columnTest.getMessage(), columnTest.getErrorArgs());
        testReport.addError(
            id,
            startTime,
            fileName,
            resourceManager.getFilePath(),
            column.getName(),
            columnTest.getTestType(),
            columnTest.getPatternString(),
            testedValue,
            columnTest.getExpectedValue());
      }
    }
  }
 private boolean canBeBlank(final String value, final Field column) {
   return !column.isMandatory() && isBlank(value);
 }