Class StringBasedErpType<T extends StringBasedErpType<T>>

java.lang.Object
com.sap.cloud.sdk.s4hana.serialization.StringBasedErpType<T>
Type Parameters:
T - The type implementing this abstract class.
All Implemented Interfaces:
ErpType<T>, StringRepresentableKey, Serializable, Comparable<T>
Direct Known Subclasses:
DistributionChannel, SapClient

@Deprecated public abstract class StringBasedErpType<T extends StringBasedErpType<T>> extends Object implements ErpType<T>, Comparable<T>, StringRepresentableKey
Deprecated.
This module will be discontinued, along with its classes and methods.
Base class for string-based ERP types.
See Also:
  • Constructor Details

    • StringBasedErpType

      public StringBasedErpType(@Nullable String value) throws IllegalArgumentException
      Deprecated.
      Constructs a new string-based type.
      Parameters:
      value - The value of the type (not null). The given string is trimmed. An empty or trimmed empty value results in an empty instance of the string-based type.
      Throws:
      IllegalArgumentException - If the given value cannot be converted to an instance of this type, or the given parameter is null.
    • StringBasedErpType

      public StringBasedErpType(@Nullable String value, @Nullable StringBasedErpType.CharCasing charCasing) throws IllegalArgumentException
      Deprecated.
      Constructs a new string-based type with a certain character casing and the english locale.
      Parameters:
      value - The value of the type (not null). The given string is trimmed. An empty or trimmed empty value results in an empty instance of the string-based type.
      charCasing - Defines the casing of characters within the string.
      Throws:
      IllegalArgumentException - If the given value cannot be converted to an instance of this type, or any of the given parameter is null.
    • StringBasedErpType

      public StringBasedErpType(@Nullable String value, @Nullable StringBasedErpType.CharCasing charCasing, @Nullable Locale locale) throws IllegalArgumentException
      Deprecated.
      Constructs a new string-based type with a certain character casing and the given locale.
      Parameters:
      value - The value of the type (not null). The given string is trimmed. An empty or trimmed empty value results in an empty instance of the string-based type.
      charCasing - Defines the casing of characters within the string.
      locale - The locale to be used to change the casing of value.
      Throws:
      IllegalArgumentException - If the given value cannot be converted to an instance of this type, or any of the given parameter is null.
  • Method Details

    • getType

      @Nonnull public abstract Class<T> getType()
      Deprecated.
      Returns the class of the string-based ERP type.
      Returns:
      The class of the string-based ERP type.
    • getMaxLength

      public abstract int getMaxLength()
      Deprecated.
      Returns the maximum length of the string-based ERP type.
      Returns:
      The maximum length of the string-based ERP type.
    • getFillCharStrategy

      @Nonnull public abstract StringBasedErpType.FillCharStrategy getFillCharStrategy()
      Deprecated.
      Returns the strategy of how the type should handle fill characters.
      Returns:
      The strategy of how the type should handle fill characters.
    • getFillChar

      public char getFillChar()
      Deprecated.
      Returns the character that is used to add or strip fill characters.
      Returns:
      The character that is used to add or strip fill characters.
    • isEmpty

      public final boolean isEmpty()
      Deprecated.
      Returns whether this string-based ERP type is empty.
      Returns:
      true if the contained string value is empty, false otherwise.
    • isDefault

      public final boolean isDefault()
      Deprecated.
      Returns whether this instance represents the default value.
      Returns:
      true if this instance represents the default SapClient.DEFAULT, false otherwise.
    • toString

      @Nonnull public final String toString()
      Deprecated.
      Overrides:
      toString in class Object
    • toString

      @Nonnull public final String toString(@Nonnull StringBasedErpType.FillCharStrategy strategy, char fillChar)
      Deprecated.
      Returns this value, filled according to the given FillCharStrategy with the give fillChar.
      Parameters:
      strategy - The strategy to be used to fill this value.
      fillChar - The character to be used to fill this value.
      Returns:
      The value according to the given fill character strategy.
    • compareTo

      public int compareTo(@Nonnull T other)
      Deprecated.
      Specified by:
      compareTo in interface Comparable<T extends StringBasedErpType<T>>
    • getKeyAsString

      @Nonnull public String getKeyAsString()
      Deprecated.
      Description copied from interface: StringRepresentableKey
      Returns the String representation of this key.
      Specified by:
      getKeyAsString in interface StringRepresentableKey
      Returns:
      This key as a String.
    • transformToString

      @Nonnull public static <T extends StringBasedErpType<T>> Function<T,String> transformToString(@Nonnull ErpTypeConverter<T> converter)
      Deprecated.
      Creates a function which transforms a given StringBasedErpType to its String representation. This function handles null gracefully and returns null itself.
      Type Parameters:
      T - The type of the subclass to transform.
      Parameters:
      converter - The converter that should transform the concrete implementation of StringBasedErpType to String.
      Returns:
      A null-safe function transforming a StringBasedErpType to String.
    • transformToType

      @Nonnull public static <T extends StringBasedErpType<T>> Function<String,T> transformToType(@Nonnull ErpTypeConverter<T> converter)
      Deprecated.
      Creates a function which transforms a given String to its StringBasedErpType representation. This function handles null gracefully and returns null itself.
      Type Parameters:
      T - The type of the subclass to create.
      Parameters:
      converter - The converter that should transform the String representation to the concrete StringBasedErpType implementation.
      Returns:
      A null-safe function transforming a String to a StringBasedErpType.
    • equals

      public boolean equals(@Nullable Object o)
      Deprecated.
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(@Nullable Object other)
      Deprecated.
    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object
    • getValue

      @Nonnull public String getValue()
      Deprecated.