Class StringPredicate

    • Method Detail

      • isNotNull

        public static Predicate<String> isNotNull()
        Checks whether the actual value is present.*
        Returns:
        Predicate to continue adding rules.
      • contains

        public static Predicate<String> contains​(CharSequence value,
                                                 CharSequence... values)
        Checks whether the given charSequences are present anywhere in the value.
        Parameters:
        value - the exact value that needs to be present in the original value.
        values - the optional exact values that needs to be present in the original value.
        Returns:
        Predicate to continue adding rules.
      • doesNotContain

        public static Predicate<String> doesNotContain​(CharSequence value,
                                                       CharSequence... values)
        Checks whether the given charSequences are present anywhere in the value.
        Parameters:
        value - the exact value that may not be present in the original value.
        values - the optional exact values that may not be present in the original value.
        Returns:
        Predicate to continue adding rules.
      • isEqualTo

        public static Predicate<String> isEqualTo​(String value)
        Check if the actual value is equal to the given one.
        Parameters:
        value - the exact expected value.
        Returns:
        Predicate to continue adding rules.
      • hasALengthOf

        public static Predicate<String> hasALengthOf​(int length)
        Parameters:
        length - the exact length of the String.
        Returns:
        Predicate to continue adding rules.
      • isNumeric

        public static Predicate<String> isNumeric()
        Adds a check if all characters are in fact digits.
        Returns:
        Predicate to continue adding rules.
      • isNotNumeric

        public static Predicate<String> isNotNumeric()
        Adds a check if any character is in fact not a digit.
        Returns:
        Predicate to continue adding rules.
      • isAlphabetic

        public static Predicate<String> isAlphabetic()
        Adds a check if all characters are in fact digits.
        Returns:
        Predicate to continue adding rules.
      • isNotAlphabetic

        public static Predicate<String> isNotAlphabetic()
        Adds a check if any character is in fact not alphabetic.
        Returns:
        Predicate to continue adding rules.
      • hasALengthBetween

        public static ConstraintAppender<Integer,​Predicate<String>> hasALengthBetween​(int length)
        Parameters:
        length - the exact length of the String.
        Returns:
        ChainingPredicate to continue adding rules.