Class StringUtils

java.lang.Object
org.axonframework.common.StringUtils

public final class StringUtils extends Object
Utility methods for when dealing with Strings.
Since:
4.5
Author:
Steven van Beelen
  • Method Details

    • nonEmptyOrNull

      public static boolean nonEmptyOrNull(@Nullable String s)
      Validate whether the given String s is not null and not empty (where empty is defined as "").
      Parameters:
      s - the String to validate whether it is not null and not empty
      Returns:
      true if the given String s is not null and not empty, false otherwise
    • emptyOrNull

      public static boolean emptyOrNull(@Nullable String s)
      Validate whether the given String s is null or not empty (where empty is defined as "").
      Parameters:
      s - The String to validate whether it is null or empty.
      Returns:
      true if the given String s is not null and not empty, false otherwise.
    • nonEmpty

      public static boolean nonEmpty(String s)
      Validate whether the given String s not empty (where empty is defined as "").
      Parameters:
      s - the String to validate whether not empty
      Returns:
      true if the given String s is not empty, false otherwise
    • lowerCaseFirstCharacterOf

      public static String lowerCaseFirstCharacterOf(String s)
      Return the given s, with its first character lowercase.
      Parameters:
      s - The input string to adjust to a version with the first character as a lowercase.
      Returns:
      The input string, with first character lowercase.
    • capitalize

      public static @Nullable String capitalize(@Nullable String string)
      Return the given string, with its first character uppercase.

      When the given string is null, the returned value is also null.

      Parameters:
      string - the input string to adjust to a version with the first character as uppercase
      Returns:
      the input string, with first character in uppercase, or null if the given string is null