Class NamingUtils

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.utility.NamingUtils

@Beta public final class NamingUtils extends Object
Utility class, that bundles various naming related operations. This class is meant for internal usage only.
  • Method Details

    • apiNameToServiceTitle

      @Nonnull public static String apiNameToServiceTitle(@Nonnull String apiName)
      Converts the given apiName into the title of a service.
      Parameters:
      apiName - The name to convert.
      Returns:
      The converted service title.
    • serviceNameToJavaPackageName

      @Nonnull public static String serviceNameToJavaPackageName(@Nonnull String serviceName)
      Converts the given serviceName into a Java package name.
      Parameters:
      serviceName - The name to convert.
      Returns:
      The converted Java package name.
    • serviceNameToBaseJavaClassName

      @Nonnull public static String serviceNameToBaseJavaClassName(@Nonnull String serviceName)
      Converts the given serviceName 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 given stringToClean with the given partReplacement.
      Parameters:
      stringToClean - The string that may contain invalid characters.
      partReplacement - The string to replace invalid characters with.
      Returns:
      The cleaned stringToClean.
    • deriveGetEntityServiceMethodName

      @Nonnull public static String deriveGetEntityServiceMethodName(@Nonnull String javaEntityClassName)
      Converts the given javaEntityClassName 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 given javaEntityClassName 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 given javaEntityClassName 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 given javaEntityClassName 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 given javaEntityClassName 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 given javaEntityClassName 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 given javaEntityClassName 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 given javaEntityClassName 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 given javaEntityClassName 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 given javaEntityClassName 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 given navigationPropertyJavaMethodName 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 given navigationPropertyJavaMethodName 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 given navigationPropertyJavaMethodName 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 given navigationPropertyJavaMethodName 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 given navigationPropertyJavaMethodName into a Java add method name.
      Parameters:
      navigationPropertyJavaMethodName - The name to convert.
      Returns:
      The converted Java method name.
    • httpMethodToApacheClientClassName

      @Nonnull public static String httpMethodToApacheClientClassName(@Nonnull String httpMethod)
      Converts the given httpMethod into a Java constant name for the appropriate HttpClient instance.
      Parameters:
      httpMethod - The name to convert.
      Returns:
      The converted Java constant name.