Package org.brapi.schematools.core.utils
Class StringUtils
java.lang.Object
org.brapi.schematools.core.utils.StringUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringmakeValidName(String string) Creates a valid name for use in GraphQLstatic booleanstartsWithLowerCase(String value) Determines if the string starts with an lower case characterstatic booleanstartsWithUpperCase(String value) Determines if the string starts with an upper case characterstatic StringtoParameterCase(String value) Makes the first letter in the string lower casestatic StringConverts the noun from its singular form to its plural formstatic StringtoSentenceCase(String value) Makes the first letter in the string upper casestatic StringtoSingular(String value) Converts the noun from its plural form to its singular form
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
toSingular
Converts the noun from its plural form to its singular form- Parameters:
value- a noun to be converted- Returns:
- singular form of a plural noun
-
toPlural
Converts the noun from its singular form to its plural form- Parameters:
value- a noun to be converted- Returns:
- plural form of a singular noun
-
makeValidName
Creates a valid name for use in GraphQL- Parameters:
string- a string which might contain invalid characters for a valid GraphQL name- Returns:
- a valid GraphQL name based on the input string
-
toSentenceCase
Makes the first letter in the string upper case- Parameters:
value- the string to be converted- Returns:
- the converted string
-
toParameterCase
Makes the first letter in the string lower case- Parameters:
value- the string to be converted- Returns:
- the converted string
-
startsWithLowerCase
Determines if the string starts with an lower case character- Parameters:
value- the string to be tested- Returns:
trueif the string starts with an lower case character,falseotherwise
-
startsWithUpperCase
Determines if the string starts with an upper case character- Parameters:
value- the string to be tested- Returns:
trueif the string starts with an upper case character,falseotherwise
-