forked from bensku/java-ts-bind
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/io/github/bensku/tsbind/binding/BindingUtil.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,22 @@ | ||
package io.github.bensku.tsbind.binding; | ||
|
||
public class BindingUtil { | ||
private static boolean allUpper(String input) { | ||
for (char c : input.toCharArray()) { | ||
// don't write in this way: if (!Character.isUpperCase(c)) | ||
if (Character.isLowerCase(c)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
public static boolean isGenericType(String name) { | ||
if (name.length() <= 3 && allUpper(name)) { | ||
return true; | ||
} | ||
|
||
// Like TCommand | ||
return name.length() >= 2 && name.startsWith("T") && Character.isUpperCase(name.toCharArray()[1]); | ||
} | ||
} |
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
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