Skip to content

Commit 51d302a

Browse files
committed
Feature OQL show result count
1 parent 15eeef4 commit 51d302a

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,11 @@
3434

3535
#Other
3636
/releases/
37+
/packages/
38+
/oqlmodule.mpr.bak
39+
/oqlmodule.mpr.lock
40+
/modeler-merge-marker
41+
/nativemobile/builds/
42+
/vendorlib/temp/
43+
.DS_Store
44+
/.svn/

OQLModule.mpr

0 Bytes
Binary file not shown.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// This file was generated by Mendix Studio Pro.
2+
//
3+
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
5+
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7+
// Other code you write will be lost the next time you deploy the project.
8+
// Special characters, e.g., é, ö, à, etc. are supported in comments.
9+
10+
package oql.actions;
11+
12+
import com.mendix.systemwideinterfaces.core.IContext;
13+
import com.mendix.systemwideinterfaces.core.UserAction;
14+
15+
public class CountLines extends UserAction<java.lang.Long>
16+
{
17+
private final java.lang.String InputString;
18+
19+
public CountLines(
20+
IContext context,
21+
java.lang.String _inputString
22+
)
23+
{
24+
super(context);
25+
this.InputString = _inputString;
26+
}
27+
28+
@java.lang.Override
29+
public java.lang.Long executeAction() throws Exception
30+
{
31+
// BEGIN USER CODE
32+
if (InputString == null) {
33+
return 0L;
34+
}
35+
return InputString.lines()
36+
.filter(line -> !line.trim().isEmpty())
37+
.count();
38+
// END USER CODE
39+
}
40+
41+
/**
42+
* Returns a string representation of this action
43+
* @return a string representation of this action
44+
*/
45+
@java.lang.Override
46+
public java.lang.String toString()
47+
{
48+
return "CountLines";
49+
}
50+
51+
// BEGIN EXTRA CODE
52+
// END EXTRA CODE
53+
}

0 commit comments

Comments
 (0)