Class NamingUtils
java.lang.Object
com.sap.cloud.sdk.datamodel.odata.utility.NamingUtils
Utility class, that bundles various naming related operations. This class is meant for internal usage only.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
apiNameToServiceTitle
(String apiName) Converts the givenapiName
into the title of a service.static String
deriveCountEntitiesServiceMethodName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java count service method name.static String
deriveCreateEntityServiceMethodName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java create service method name.static String
deriveDeleteEntityServiceMethodName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java delete service method name.static String
deriveGetAllEntitiesServiceMethodName
(String javaEntityClassName) Converts the given {javaEntityClassName} into a Java getAll service method name.static String
deriveGetEntityServiceMethodName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java getByKey service method name.static String
deriveJavaAddMethodName
(String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java add method name.static String
deriveJavaCreateFluentHelperClassName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelperCreate class name.static String
deriveJavaDeleteFluentHelperClassName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelperDelete class name.static String
deriveJavaEntityByKeyFluentHelperClassName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelperByKey class name.static String
deriveJavaEntityFluentHelperClassName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelper class name.static String
deriveJavaFetchMethodName
(String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java fetch method name.static String
deriveJavaGetIfPresentMethodName
(String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java getIfPresent method name.static String
deriveJavaGetOrFetchMethodName
(String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java getOrFetch method name.static String
deriveJavaSetMethodName
(String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java set method name.static String
deriveJavaUpdateFluentHelperClassName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelperUpdate class name.static String
deriveUpdateEntityServiceMethodName
(String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java update service method name.static String
httpMethodToApacheClientClassName
(String httpMethod) Converts the givenhttpMethod
into a Java constant name for the appropriate HttpClient instance.static String
replaceInvalidJavaCharacters
(CharSequence stringToClean, String partReplacement) Replaces all characters that are not part of a valid Java name within the givenstringToClean
with the givenpartReplacement
.static String
serviceNameToBaseJavaClassName
(String serviceName) Converts the givenserviceName
into a base name for a Java class.static String
serviceNameToJavaPackageName
(String serviceName) Converts the givenserviceName
into a Java package name.
-
Method Details
-
apiNameToServiceTitle
Converts the givenapiName
into the title of a service.- Parameters:
apiName
- The name to convert.- Returns:
- The converted service title.
-
serviceNameToJavaPackageName
Converts the givenserviceName
into a Java package name.- Parameters:
serviceName
- The name to convert.- Returns:
- The converted Java package name.
-
serviceNameToBaseJavaClassName
Converts the givenserviceName
into a base name for a Java class.- Parameters:
serviceName
- The name to convert.- Returns:
- The converted base name for a Java class.
-
replaceInvalidJavaCharacters
@Nonnull public static String replaceInvalidJavaCharacters(@Nonnull CharSequence stringToClean, @Nullable String partReplacement) Replaces all characters that are not part of a valid Java name within the givenstringToClean
with the givenpartReplacement
.- Parameters:
stringToClean
- The string that may contain invalid characters.partReplacement
- The string to replace invalid characters with.- Returns:
- The cleaned
stringToClean
.
-
deriveGetEntityServiceMethodName
Converts the givenjavaEntityClassName
into a Java getByKey service method name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveGetAllEntitiesServiceMethodName
@Nonnull public static String deriveGetAllEntitiesServiceMethodName(@Nonnull String javaEntityClassName) Converts the given {javaEntityClassName} into a Java getAll service method name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveCountEntitiesServiceMethodName
@Nonnull public static String deriveCountEntitiesServiceMethodName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java count service method name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveCreateEntityServiceMethodName
@Nonnull public static String deriveCreateEntityServiceMethodName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java create service method name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveUpdateEntityServiceMethodName
@Nonnull public static String deriveUpdateEntityServiceMethodName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java update service method name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveDeleteEntityServiceMethodName
@Nonnull public static String deriveDeleteEntityServiceMethodName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java delete service method name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveJavaEntityFluentHelperClassName
@Nonnull public static String deriveJavaEntityFluentHelperClassName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelper class name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java class name.
-
deriveJavaEntityByKeyFluentHelperClassName
@Nonnull public static String deriveJavaEntityByKeyFluentHelperClassName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelperByKey class name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java class name.
-
deriveJavaCreateFluentHelperClassName
@Nonnull public static String deriveJavaCreateFluentHelperClassName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelperCreate class name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java class name.
-
deriveJavaUpdateFluentHelperClassName
@Nonnull public static String deriveJavaUpdateFluentHelperClassName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelperUpdate class name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java class name.
-
deriveJavaDeleteFluentHelperClassName
@Nonnull public static String deriveJavaDeleteFluentHelperClassName(@Nonnull String javaEntityClassName) Converts the givenjavaEntityClassName
into a Java FluentHelperDelete class name.- Parameters:
javaEntityClassName
- The name to convert.- Returns:
- The converted Java class name.
-
deriveJavaFetchMethodName
@Nonnull public static String deriveJavaFetchMethodName(@Nonnull String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java fetch method name.- Parameters:
navigationPropertyJavaMethodName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveJavaGetIfPresentMethodName
@Nonnull public static String deriveJavaGetIfPresentMethodName(@Nonnull String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java getIfPresent method name.- Parameters:
navigationPropertyJavaMethodName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveJavaGetOrFetchMethodName
@Nonnull public static String deriveJavaGetOrFetchMethodName(@Nonnull String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java getOrFetch method name.- Parameters:
navigationPropertyJavaMethodName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveJavaSetMethodName
@Nonnull public static String deriveJavaSetMethodName(@Nonnull String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java set method name.- Parameters:
navigationPropertyJavaMethodName
- The name to convert.- Returns:
- The converted Java method name.
-
deriveJavaAddMethodName
@Nonnull public static String deriveJavaAddMethodName(@Nonnull String navigationPropertyJavaMethodName) Converts the givennavigationPropertyJavaMethodName
into a Java add method name.- Parameters:
navigationPropertyJavaMethodName
- The name to convert.- Returns:
- The converted Java method name.
-
httpMethodToApacheClientClassName
Converts the givenhttpMethod
into a Java constant name for the appropriate HttpClient instance.- Parameters:
httpMethod
- The name to convert.- Returns:
- The converted Java constant name.
-