diff options
| author | wangkuan <[email protected]> | 2023-12-19 18:28:57 +0800 |
|---|---|---|
| committer | wangkuan <[email protected]> | 2023-12-19 18:28:57 +0800 |
| commit | 694dca052d291f01a122154fdc2c356e4a8fcf54 (patch) | |
| tree | bd9234f1c9f625e35678e9067520787bbc5260e5 /groot-common | |
| parent | ff28a1cc2c58a3455295b677c0eaed2f2a475065 (diff) | |
[improve][core] projectionprocess支持remove_fields属性配置
Diffstat (limited to 'groot-common')
| -rw-r--r-- | groot-common/src/main/java/com/geedgenetworks/common/utils/ColumnUtil.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/groot-common/src/main/java/com/geedgenetworks/common/utils/ColumnUtil.java b/groot-common/src/main/java/com/geedgenetworks/common/utils/ColumnUtil.java index 7278261..9bc936d 100644 --- a/groot-common/src/main/java/com/geedgenetworks/common/utils/ColumnUtil.java +++ b/groot-common/src/main/java/com/geedgenetworks/common/utils/ColumnUtil.java @@ -7,10 +7,10 @@ import java.util.Map; public class ColumnUtil { public static Map<String, Object> columnSelector( - Map<String, Object> extractedFields, List<String> output_fields) { + Map<String, Object> extractedFields, List<String> output_fields) { Map<String, Object> newExtractedFields = new HashMap<>(); - if (output_fields != null && output_fields.size() > 0) { + if (output_fields != null && !output_fields.isEmpty()) { for (String field : output_fields) { @@ -23,4 +23,16 @@ public class ColumnUtil { return extractedFields; } } + + public static Map<String, Object> columnRemover( + Map<String, Object> extractedFields, List<String> remove_fields) { + if (remove_fields != null && !remove_fields.isEmpty()) { + + for (String field : remove_fields) { + + extractedFields.remove(field); + } + } + return extractedFields; + } } |
