public final class NamesUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
afterLast(String string,
String separator)
Returns the first element after the last separator presence.
|
static String |
afterLastDot(String string)
Returns the first element after the last dot presence.
|
static String |
beforeLast(String string,
String separator)
Returns the first element before the last separator presence.
|
static String |
camelCase(String className)
Converts a string into a camel case format.
|
static String |
capitalize(String className)
Capitalizes the provided string.
|
static String |
convertIllegalMethodNameChars(String methodName)
Converts illegal characters in method names to underscores.
|
static String |
convertIllegalPackageChars(String packageName)
Converts illegal package characters to underscores.
|
static String |
defaultContractName(File file,
Collection contracts,
int counter) |
static String |
directoryToPackage(String directory)
Converts the path format to a Java package notation.
|
static boolean |
hasDot(String string) |
static boolean |
hasSeparator(String string,
String separator)
Returns
true if has a separatot in the string. |
static boolean |
isEmpty(String string) |
static String |
packageToDirectory(String packageName)
Converts the Java package notation to a path format.
|
static void |
recrusiveDirectoryToPackage(File rootDir)
Traverses the directories and converts renames illegal folder names to package
names.
|
static String |
toLastDot(String string)
Returns the whole string to the last present dot.
|
public static String beforeLast(String string, String separator)
public static String afterLast(String string, String separator)
public static boolean hasSeparator(String string, String separator)
true
if has a separatot in the string.public static String afterLastDot(String string)
public static boolean hasDot(String string)
true
if has a dotpublic static String defaultContractName(File file, Collection contracts, int counter)
file
- - file with contractscontracts
- - collection of contractscounter
- - given contract indexpublic static String camelCase(String className)
public static boolean isEmpty(String string)
public static String toLastDot(String string)
public static String packageToDirectory(String packageName)
public static String directoryToPackage(String directory)
public static void recrusiveDirectoryToPackage(File rootDir)
rootDir
- - folder from which to start traversingpublic static String convertIllegalPackageChars(String packageName)
Copyright © 2016–2022 Spring. All rights reserved.