NIFI-5217: Allow non-nullable fields to be added to MockRecordParser

Signed-off-by: Matthew Burgess <mattyb149@apache.org>

This closes #2720
This commit is contained in:
Matthew Burgess 2018-05-18 15:17:03 -04:00
parent 29e96ed0e0
commit d79216d6b0
2 changed files with 6 additions and 2 deletions

View File

@ -24,7 +24,7 @@ import java.util.Objects;
import java.util.Set;
public class RecordField {
private static final boolean DEFAULT_NULLABLE = true;
public static final boolean DEFAULT_NULLABLE = true;
private final String fieldName;
private final DataType dataType;

View File

@ -51,7 +51,11 @@ public class MockRecordParser extends AbstractControllerService implements Recor
}
public void addSchemaField(final String fieldName, final RecordFieldType type) {
fields.add(new RecordField(fieldName, type.getDataType()));
addSchemaField(fieldName, type, RecordField.DEFAULT_NULLABLE);
}
public void addSchemaField(final String fieldName, final RecordFieldType type, boolean isNullable) {
fields.add(new RecordField(fieldName, type.getDataType(), isNullable));
}
public void addRecord(Object... values) {