Class RenameField
java.lang.Object
com.northconcepts.datapipeline.transform.Transformer
com.northconcepts.datapipeline.transform.RenameField
See
FieldPath for supported field name expressions.-
Constructor Summary
ConstructorsConstructorDescriptionRenameField(FieldPath oldFieldPath, String newName) Creates a new transformer to rename fields in a dataset using aFieldPathas the source and a new name as the target.RenameField(String oldFieldPathExpression, String newName) Creates a new transformer to rename fields in a dataset using an expression as the source and a new name as the target. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.booleanIndicates if a field may be renamed to the name of another field in its record instead of throwing (default is false).setAllowDuplicateFieldNames(boolean allowDuplicateFieldNames) Indicates if a field may be renamed to the name of another field in its record instead of throwing (default is false).toString()booleanApplies this transformer to a record on its way through aTransformingReaderorTransformingWriter.Methods inherited from class com.northconcepts.datapipeline.transform.Transformer
addExceptionProperties, close, geEndpoint, getEndpoint, getReader, getWriter, of, open, setWriter
-
Constructor Details
-
RenameField
Creates a new transformer to rename fields in a dataset using an expression as the source and a new name as the target. This transformer does not change the nested location of the field, only its name. SeeFieldPathfor supported field name expressions.- Parameters:
oldFieldPathExpression-newName-
-
RenameField
Creates a new transformer to rename fields in a dataset using aFieldPathas the source and a new name as the target. This transformer does not change the nested location of the field, only its name. SeeFieldPathfor supported field name expressions.- Parameters:
oldFieldPath-newName-
-
-
Method Details
-
getOldFieldPath
-
getOldFieldPathAsString
-
getOldName
Deprecated.usegetOldFieldPathAsString()instead. -
getNewName
-
isAllowDuplicateFieldNames
public boolean isAllowDuplicateFieldNames()Indicates if a field may be renamed to the name of another field in its record instead of throwing (default is false). -
setAllowDuplicateFieldNames
Indicates if a field may be renamed to the name of another field in its record instead of throwing (default is false). -
transform
Description copied from class:TransformerApplies this transformer to a record on its way through aTransformingReaderorTransformingWriter.Contract for subclasses (see also
docs/authoring/Transformer.md):- Mutate
recordin place as needed. - Return
trueto keep the record in the pipeline. - Return
falseto drop the record (the host routes it to a discard writer if one is configured, otherwise it disappears). - Throw to fail (or route to a discard writer, depending on host configuration).
- Do not call
incrementRecordCount()on the host endpoint; the host handles it.
- Specified by:
transformin classTransformer- Throws:
Throwable
- Mutate
-
toString
-
getOldFieldPathAsString()instead.