mirror of https://github.com/apache/nifi.git
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:
parent
29e96ed0e0
commit
d79216d6b0
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue