-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: add unify functions transform4j vi4j random4j #4
- Loading branch information
1 parent
8444d95
commit 5256bd9
Showing
4 changed files
with
409 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
plugin/src/main/groovy/org/unify4j/common/Transform4j.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.unify4j.common; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class Transform4j { | ||
protected static final Logger logger = LoggerFactory.getLogger(Transform4j.class); | ||
|
||
/** | ||
* Converts an array of strings to a single character array. | ||
* | ||
* @param arrays The array of strings to be converted. | ||
* @return A character array containing the characters from the input strings. | ||
*/ | ||
public static char[] fromArray2Chars(String[] arrays) { | ||
if (arrays == null || arrays.length == 0) { | ||
return new char[0]; | ||
} | ||
StringBuilder builder = new StringBuilder(); | ||
for (String s : arrays) { | ||
if (s != null) { | ||
builder.append(s); | ||
} | ||
} | ||
return builder.toString().toCharArray(); | ||
} | ||
} |
Oops, something went wrong.