Class StringUtils


  • public final class StringUtils
    extends Object
    String utility functions
    Author:
    Bas Rutten
    • Method Detail

      • camelCaseToHumanFriendly

        public static String camelCaseToHumanFriendly​(String camelCaseString,
                                                      boolean capitalize)
        Converts CamelCase string to human friendly
        Parameters:
        camelCaseString - the Camel Case string to convert
        capitalize - indicates whether to capitalize every word (if set to false then only the first word will be capitalized
        Returns:
      • getHtmlLineBreak

        public static String getHtmlLineBreak()
      • isValidEmail

        public static boolean isValidEmail​(String value)
        Checks if an value is a valid email address - this is actually a very simple check that only checks for the @-sign
        Parameters:
        value - the value to check
      • prependProtocol

        public static String prependProtocol​(String value)
        Prepends the default protocol ("http://") to a value that represents a URL
        Parameters:
        value - the value
        Returns:
      • propertyIdToHumanFriendly

        public static String propertyIdToHumanFriendly​(Object propertyId,
                                                       boolean capitalize)
        Converts a propertyId to a
        Parameters:
        propertyId - the ID of the property
        Returns:
      • restrictToMaxFieldLength

        public static String restrictToMaxFieldLength​(String value,
                                                      Class<?> clazz,
                                                      String fieldName)
        Restricts a string value to the maximum length of a certain field
        Parameters:
        value -
        clazz -
        fieldName -
        Returns: