@@ -69,7 +69,7 @@ static Optional<String> at(final String value, int index) {
6969 *
7070 * @param value input
7171 * @param start start
72- * @param end end
72+ * @param end end
7373 * @return Array containing different parts between start and end.
7474 */
7575
@@ -124,7 +124,7 @@ static void validate(String value, Predicate<String> predicate, final Supplier<S
124124 /**
125125 * Verifies that the needle is contained in the value. The search is case insensitive
126126 *
127- * @param value to search
127+ * @param value to search
128128 * @param needle to find
129129 * @return true if found else false.
130130 */
@@ -133,11 +133,10 @@ static boolean contains(final String value, final String needle) {
133133 }
134134
135135 /**
136- *
137136 * Verifies that the needle is contained in the value.
138137 *
139- * @param value to search
140- * @param needle to find
138+ * @param value to search
139+ * @param needle to find
141140 * @param caseSensitive true or false
142141 * @return true if found else false.
143142 */
@@ -148,4 +147,29 @@ static boolean contains(final String value, final String needle, final boolean c
148147 }
149148 return value .toLowerCase ().indexOf (needle .toLowerCase ()) > -1 ;
150149 }
150+
151+ /**
152+ * Verifies that all needles are contained in value. The search is case insensitive
153+ *
154+ * @param value input String to search
155+ * @param needles needles to find
156+ * @return true if all needles are found else false.
157+ */
158+ static boolean containsAll (String value , String [] needles ) {
159+ validate (value , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER );
160+ return Arrays .stream (needles ).allMatch (needle -> contains (value , needle , false ));
161+ }
162+
163+ /**
164+ * Verifies that all needles are contained in value
165+ *
166+ * @param value input String to search
167+ * @param needles needles to find
168+ * @param caseSensitive true or false
169+ * @return true if all needles are found else false.
170+ */
171+ static boolean containsAll (String value , String [] needles , boolean caseSensitive ) {
172+ validate (value , NULL_STRING_PREDICATE , NULL_STRING_MSG_SUPPLIER );
173+ return Arrays .stream (needles ).allMatch (needle -> contains (value , needle , caseSensitive ));
174+ }
151175}
0 commit comments