Package org.neo4j.cypherdsl.core.utils
Class Strings
- java.lang.Object
-
- org.neo4j.cypherdsl.core.utils.Strings
-
@API(status=INTERNAL, since="2020.1.0") public final class Strings extends java.lang.Object
The usual, static class with helper methods centered around missing functionality inString
. Not supported for external use in anyway.- Since:
- 2020.1.0
- Author:
- Michael J. Simons
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
hasText(java.lang.String str)
static boolean
isIdentifier(java.lang.CharSequence name)
This is a literal copy ofSourceVersion.isIdentifier(CharSequence)
included here to be not dependent on the compiler module.static boolean
isValidJavaIdentifierPartAt(int p, int codePoint)
A convinience method to decide whether a givencodePoint
is a valid Java identifier at the given positionp
.static java.lang.String
randomIdentifier(int length)
-
-
-
Method Detail
-
hasText
public static boolean hasText(java.lang.String str)
- Parameters:
str
- A string to be checked for text.- Returns:
- True, if the strign is neither null nor empty nor blank.
-
randomIdentifier
public static java.lang.String randomIdentifier(int length)
- Parameters:
length
- The length of the identifier to generate.- Returns:
- A random identifier that is a valid identifier
-
isIdentifier
public static boolean isIdentifier(java.lang.CharSequence name)
This is a literal copy ofSourceVersion.isIdentifier(CharSequence)
included here to be not dependent on the compiler module.- Parameters:
name
- A possible Java identifier- Returns:
- True, if
name
represents an identifier.
-
isValidJavaIdentifierPartAt
public static boolean isValidJavaIdentifierPartAt(int p, int codePoint)
A convinience method to decide whether a givencodePoint
is a valid Java identifier at the given positionp
.- Parameters:
p
- Position on which thecodePoint
is supposed to be used as identifiercodePoint
- A codepoint- Returns:
- True if the codePoint could be used as part of an identifier at the given position
-
-