|
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 communitycommons.actions; |
11 | | - |
12 | | -import communitycommons.StringUtils; |
13 | | -import com.mendix.systemwideinterfaces.core.IContext; |
14 | | -import com.mendix.webui.CustomJavaAction; |
15 | | - |
16 | | -/** |
17 | | - * Hashes a value using the SHA-256 hash algorithm. |
18 | | - * |
19 | | - * - value : the value to hash |
20 | | - * - length : the desired length of the hash. |
21 | | - * |
22 | | - * Returns a SHA-256 hash of 'value', with length 'length' |
23 | | - */ |
24 | | -public class Hash extends CustomJavaAction<java.lang.String> |
25 | | -{ |
26 | | - private java.lang.String value; |
27 | | - private java.lang.Long length; |
28 | | - |
29 | | - public Hash(IContext context, java.lang.String value, java.lang.Long length) |
30 | | - { |
31 | | - super(context); |
32 | | - this.value = value; |
33 | | - this.length = length; |
34 | | - } |
35 | | - |
36 | | - @java.lang.Override |
37 | | - public java.lang.String executeAction() throws Exception |
38 | | - { |
39 | | - // BEGIN USER CODE |
40 | | - return StringUtils.hash(value, length.intValue()); |
41 | | - // END USER CODE |
42 | | - } |
43 | | - |
44 | | - /** |
45 | | - * Returns a string representation of this action |
46 | | - * @return a string representation of this action |
47 | | - */ |
48 | | - @java.lang.Override |
49 | | - public java.lang.String toString() |
50 | | - { |
51 | | - return "Hash"; |
52 | | - } |
53 | | - |
54 | | - // BEGIN EXTRA CODE |
55 | | - // END EXTRA CODE |
56 | | -} |
| 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 communitycommons.actions; |
| 11 | + |
| 12 | +import communitycommons.StringUtils; |
| 13 | +import com.mendix.systemwideinterfaces.core.IContext; |
| 14 | +import com.mendix.webui.CustomJavaAction; |
| 15 | + |
| 16 | +/** |
| 17 | + * Hashes a value using the SHA-256 hash algorithm. |
| 18 | + * |
| 19 | + * - value : the value to hash |
| 20 | + * - length : the desired length of the hash. |
| 21 | + * |
| 22 | + * Returns a SHA-256 hash of 'value', with length 'length' |
| 23 | + */ |
| 24 | +public class Hash extends CustomJavaAction<java.lang.String> |
| 25 | +{ |
| 26 | + private java.lang.String value; |
| 27 | + private java.lang.Long length; |
| 28 | + |
| 29 | + public Hash(IContext context, java.lang.String value, java.lang.Long length) |
| 30 | + { |
| 31 | + super(context); |
| 32 | + this.value = value; |
| 33 | + this.length = length; |
| 34 | + } |
| 35 | + |
| 36 | + @java.lang.Override |
| 37 | + public java.lang.String executeAction() throws Exception |
| 38 | + { |
| 39 | + // BEGIN USER CODE |
| 40 | + return StringUtils.hash(value); |
| 41 | + // END USER CODE |
| 42 | + } |
| 43 | + |
| 44 | + /** |
| 45 | + * Returns a string representation of this action |
| 46 | + * @return a string representation of this action |
| 47 | + */ |
| 48 | + @java.lang.Override |
| 49 | + public java.lang.String toString() |
| 50 | + { |
| 51 | + return "Hash"; |
| 52 | + } |
| 53 | + |
| 54 | + // BEGIN EXTRA CODE |
| 55 | + // END EXTRA CODE |
| 56 | +} |
|
0 commit comments