Class RemoveDuplicateFields.RenamePolicy
java.lang.Object
com.northconcepts.datapipeline.transform.RemoveDuplicateFields.RenamePolicy
- All Implemented Interfaces:
RemoveDuplicateFields.IDuplicateFieldsPolicy
- Enclosing class:
RemoveDuplicateFields
public static class RemoveDuplicateFields.RenamePolicy
extends Object
implements RemoveDuplicateFields.IDuplicateFieldsPolicy
An alternative to
RemoveDuplicateFields.DuplicateFieldsPolicy.RENAME that uses a configurable separator between
the original field name and the numeric suffix, preventing ambiguous names like 20101 when
the field name itself ends in digits (e.g. 2010 becomes 2010_1 with separator "_").-
Constructor Summary
ConstructorsConstructorDescriptionRenamePolicy(String separator) Creates a policy that renames each later duplicate to its name, the separator and the first unused number from 1; null means no separator. -
Method Summary
Modifier and TypeMethodDescriptionvoidResolves the duplicates inrecord;duplicateFieldsMapmaps each duplicated name to its fields (two or more) in record order.
-
Constructor Details
-
RenamePolicy
Creates a policy that renames each later duplicate to its name, the separator and the first unused number from 1; null means no separator.
-
-
Method Details
-
getSeparator
-
handleDuplicateFields
Description copied from interface:RemoveDuplicateFields.IDuplicateFieldsPolicyResolves the duplicates inrecord;duplicateFieldsMapmaps each duplicated name to its fields (two or more) in record order.- Specified by:
handleDuplicateFieldsin interfaceRemoveDuplicateFields.IDuplicateFieldsPolicy
-