Class Utils

java.lang.Object
org.springframework.shell.Utils

public class Utils extends Object
Some text utilities.
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • unCamelify

      public static String unCamelify(CharSequence original)
      Turn CamelCaseText into gnu-style-lowercase.
    • createMethodParameter

      public static org.springframework.core.MethodParameter createMethodParameter(Parameter parameter)
      Convert from JDK Parameter to Spring MethodParameter.
    • createMethodParameter

      public static org.springframework.core.MethodParameter createMethodParameter(Executable executable, int i)
      Return a properly initialized MethodParameter for the given executable and index.
    • createMethodParameters

      public static Stream<org.springframework.core.MethodParameter> createMethodParameters(Executable executable)
      Return MethodParameters for each parameter of the given method/constructor.
    • sanitizeInput

      public static List<String> sanitizeInput(List<String> words)
      Sanitize the buffer input given the customizations applied to the JLine parser (e.g. support for line continuations, etc.)
    • defaultValidatorFactory

      public static jakarta.validation.ValidatorFactory defaultValidatorFactory()
      Gets a default shared validation factory.
      Returns:
      default validation factory
    • defaultValidator

      public static jakarta.validation.Validator defaultValidator()
      Gets a default shared validator.
      Returns:
      default validator
    • split

      public static <T> List<List<T>> split(T[] array, Predicate<T> predicate)
      Split array into list of lists by predicate
      Parameters:
      array - the array
      predicate - the predicate
      Returns:
      the list of lists
    • removeHiddenCommands

      public static Map<String,CommandRegistration> removeHiddenCommands(Map<String,CommandRegistration> registrations)
      Takes a map of command registrations and removes hidden commands from it.
      Parameters:
      registrations - a command registrations
      Returns:
      same map with removed hidden commands