public void validateKeyField(Schema inputSchema){
  if (inputSchema != null && inputSchema.getField(keyField) == null) {
    throw new IllegalArgumentException(String.format("Key field '%s' does not exist in the input schema %s",keyField,inputSchema));
  }
}

public void validateKeyField ( Schema inputSchema ) { if ( inputSchema != null && inputSchema . getField ( keyField ) == null ) { throw new IllegalArgumentException ( String . format ( "Key field '%s' does not exist in the input schema %s" , keyField , inputSchema ) ) ; } }
validates whether the key field is present in the input schema or not .
