[ 
https://issues.apache.org/jira/browse/KNOX-2018?focusedWorklogId=316766&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-316766
 ]

ASF GitHub Bot logged work on KNOX-2018:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Sep/19 16:08
            Start Date: 23/Sep/19 16:08
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on pull request #151: KNOX-2018 - 
KnoxShellTable Filtering needs greaterThan and lessThan, equals methods
URL: https://github.com/apache/knox/pull/151#discussion_r327201437
 
 

 ##########
 File path: 
gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxShellTable.java
 ##########
 @@ -654,5 +655,146 @@ public KnoxShellTable regex(String regex) {
       }
       return table;
     }
+
+    public KnoxShellTable filter(Predicate p) {
+        KnoxShellTable table = new KnoxShellTable();
+        table.headers.addAll(headers);
+        for (List<String> row : rows) {
+          if (p.test(row.get(index))) {
+            table.row();
+            row.forEach(value -> {
+              table.value(value);
+            });
+          }
+        }
+        return table;
+      }
+
+      public KnoxShellTable greaterThan(String comparator) {
 
 Review comment:
   You may consider changing the method signature to `greaterThan(Comparable 
combarable), lessThan(Comparable comparable),...` to achieve what @risdenk 
suggested.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 316766)
    Time Spent: 1h  (was: 50m)

> KnoxShellTable Filtering needs greaterThan and lessThan, equals Methods
> -----------------------------------------------------------------------
>
>                 Key: KNOX-2018
>                 URL: https://issues.apache.org/jira/browse/KNOX-2018
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: KnoxShell
>            Reporter: Larry McCay
>            Assignee: Ljmiv
>            Priority: Major
>              Labels: noob
>             Fix For: 1.4.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> It would be useful to have greaterThan and lessThan filtering for 
> KnoxShellTable.
> Currently we have a regex match to filter matches.
> Some easier methods for greaterThan, lessThan, equals, equalsIgnoreCare, etc 
> would be very helpful as regex for those things may be possible but more 
> complicated than necessary.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to