Interface DataFixer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines a function for mutating and upgrading serialized structures.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceValidation condition format wrapper ensuring safety checking bypasses compiler wildcard strictness overrides.static interfaceBlueprint for physical node array interception functions.static interfaceBlueprint for physical node map interception functions. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataFixeraddDefault(String key, Object value) Injects a predefined default primitive value if a key node does not physically exist.static DataFixerChains sequential data fixers together in execution order.static DataFixerconditional(DataFixer.DataPredicate predicate, DataFixer thenFixer, DataFixer elseFixer) Redirects internal data handling dependent on an explicitly provided logical predicate.<D> Dfix(DynamicOps<D> ops, D input) Applies the required data transformation logic utilizing dynamic operations.static DataFixerElevates a deeply nested map key up to the parent map execution level.static DataFixerlistTransform(DataFixer.ListTransformer transformer) Executes a structural logic transformation on a data node representing a list.static DataFixermapTransform(DataFixer.MapTransformer transformer) Executes a structural logic transformation on a data node representing a map.static DataFixerFlattens and shifts explicitly defined sibling keys into a shared child nested map.static DataFixerTranslates a nested path expression into a sequence of modifications down the tree structure.static DataFixerDeletes a specific key entirely from the map structure.static DataFixerReplaces a specific map key with a new identifier.static DataFixerreorderKeys(String... patterns) Reorders keys within a map structure based on advanced pattern matching algorithms.static DataFixertransformValue(String key, DataFixer valueFixer) Recursively passes a specific map entry's value to a secondary fixer logic.static DataFixerupdateElements(DataFixer elementFixer) Triggers cyclic recursive transformation operations universally executing across all array node elements.
-
Method Details
-
fix
Applies the required data transformation logic utilizing dynamic operations.- Type Parameters:
D- The target serialization format type.- Parameters:
ops- The dynamic operations logic used to navigate data.input- The current data payload to mutate.- Returns:
- The mutated, upgraded serialized data.
-
compose
-
mapTransform
Executes a structural logic transformation on a data node representing a map.- Parameters:
transformer- The logic defining map modifications.- Returns:
- A DataFixer encapsulating the map transform task.
-
listTransform
Executes a structural logic transformation on a data node representing a list.- Parameters:
transformer- The logic defining list modifications.- Returns:
- A DataFixer encapsulating the list transform task.
-
path
Translates a nested path expression into a sequence of modifications down the tree structure.- Parameters:
path- The literal target nested segment using the compiled DataPath syntax.fixer- The isolated logic running at the resolved path destination.- Returns:
- A DataFixer managing nested traversal constraints.
-
renameKey
-
removeKey
-
transformValue
Recursively passes a specific map entry's value to a secondary fixer logic.- Parameters:
key- The map key housing the nested structure to fix.valueFixer- The sub-fixer to execute against the nested data.- Returns:
- A DataFixer executing the conditional map transform.
-
hoistKey
-
nestKeys
Flattens and shifts explicitly defined sibling keys into a shared child nested map.- Parameters:
newMapKey- The new identifier for the overarching map wrapper.keysToNest- Variadic target array of explicit keys to condense.- Returns:
- A DataFixer executing the shift map transform.
-
addDefault
-
reorderKeys
Reorders keys within a map structure based on advanced pattern matching algorithms.Supported Pattern Syntax:
- Exact Match:
"key_name" - Prefix Match:
"prefix_*" - Suffix Match:
"*_suffix" - Contains Match:
"*contains*" - Regex Match:
"~^regex.*$"(Prefixed with tilde) - Remainder/Dump:
"*"(Captures any keys not matched by explicit rules)
- Parameters:
patterns- Sequential string rules prioritizing and organizing keys.- Returns:
- A DataFixer executing structural sorting logic on the current node.
- Exact Match:
-
conditional
static DataFixer conditional(DataFixer.DataPredicate predicate, DataFixer thenFixer, DataFixer elseFixer) Redirects internal data handling dependent on an explicitly provided logical predicate.- Parameters:
predicate- The verification condition encapsulating the current environment dynamic ops.thenFixer- Evaluated pipeline branch when the predicate returns physically true.elseFixer- Evaluated pipeline branch when the predicate returns physically false.- Returns:
- A DataFixer executing contextual branch resolution.
-
updateElements
Triggers cyclic recursive transformation operations universally executing across all array node elements.- Parameters:
elementFixer- Target internal sub-fixer iteration logic block.- Returns:
- A DataFixer sequentially passing node list data to the provided execution target.
-