Package com.helger.commons.error.list
Interface IErrorList
- All Superinterfaces:
Collection<IError>,ICloneable<ICommonsList<IError>>,ICommonsCollection<IError>,ICommonsIterable<IError>,ICommonsList<IError>,IHasErrorLevels<IError>,IHasSize,Iterable<IError>,List<IError>,SequencedCollection<IError>
- All Known Implementing Classes:
ErrorList
@MustImplementEqualsAndHashcode
public interface IErrorList
extends ICommonsList<IError>, IHasErrorLevels<IError>
Interface for a list of
IError objects.- Since:
- 8.5.0
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> ICommonsList<T> getAllDataItems(Function<? super IError, ? extends T> aExtractor) Get a list with only a single data element.default IErrorListGet a resource error group containing only the error elements.default IErrorListGet a resource error group containing only the failure elements.default ICommonsList<String> getAllTexts(Locale aContentLocale) Get a list with all contained texts.default <T> ICommonsOrderedMap<T, ICommonsList<IError>> getGrouped(Function<? super IError, T> aKeyExtractor) default ICommonsMap<String, ICommonsList<IError>> default ICommonsMap<String, ICommonsList<IError>> default IErrorListgetListOfField(String sSearchFieldName) Get a sub-list with all entries for the specified field namedefault IErrorListgetListOfFields(String... aSearchFieldNames) Get a sub-list with all entries for the specified field namesdefault IErrorListgetListOfFields(Collection<String> aSearchFieldNames) Get a sub-list with all entries for the specified field namesdefault IErrorListgetListOfFieldsRegExp(String sRegExp) Get a sub-list with all entries that have field names matching the passed regular expression.default IErrorListgetListOfFieldsStartingWith(String... aSearchFieldNames) Get a sub-list with all entries that have field names starting with one of the supplied names.default IErrorListGet a sub-list with all entries that does not contain an error field name.getSubList(Predicate<? super IError> aFilter) Get a sub-list with all entries that match the provided predicate.default booleanhasEntryForField(String sSearchFieldName) Check if any entry for the specified field is presentdefault booleanhasEntryForField(String sSearchFieldName, IErrorLevel aErrorLevel) Check if any entry for the specified field and the specified error level is presentdefault booleanhasEntryForFields(String... aSearchFieldNames) Check if any entry for the specified fields are presentdefault booleanhasErrorForField(String sSearchFieldName) Check if any error entry for the specified field is presentdefault booleanhasNoEntryForField(String sSearchFieldName) Check if no entry for the specified field is presentdefault booleanhasNoEntryForFields(String... aSearchFieldNames) Check if no entry for the specified fields are presentMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface com.helger.commons.lang.ICloneable
getCloneMethods inherited from interface com.helger.commons.collection.impl.ICommonsCollection
addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addIf, addIfNotNull, addObject, getAtIndex, getAtIndex, getAtIndex, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getCopyAsList, getCount, getSorted, iterator2, removeAll, removeObject, set, setAll, setAll, setAllMapped, setAllMappedMethods inherited from interface com.helger.commons.collection.impl.ICommonsIterable
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEachBreakable, forEachByIndex, forEachThrowing, getCountMethods inherited from interface com.helger.commons.collection.impl.ICommonsList
createInstance, getAll, getAllInstanceOf, getAllMapped, getAllMapped, getAsUnmodifiable, getAtIndex, getFirst, getFirst, getFirstOrNull, getLast, getLast, getLastOrNull, getSortedInline, removeAndReturnElementAtIndex, removeAtIndex, removeFirst, removeFirstOrNull, removeLast, removeLastOrNull, reverse, setFirst, setLast, swapItemsMethods inherited from interface com.helger.commons.error.level.IHasErrorLevels
containsAtLeastOneError, containsAtLeastOneFailure, containsAtLeastOneSuccess, containsAtLeastOneWarningOrError, containsNoError, containsNoFailure, containsNoSuccess, containsOnlyError, containsOnlyFailure, containsOnlySuccess, getErrorCount, getFailureCount, getMostSevereErrorLevel, getSuccessCountMethods inherited from interface com.helger.commons.lang.IHasSize
isEmpty, isNotEmpty, sizeMethods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray
-
Method Details
-
hasNoEntryForField
Check if no entry for the specified field is present- Parameters:
sSearchFieldName- The field name to search.- Returns:
trueif no entry for the specified field is present
-
hasNoEntryForFields
Check if no entry for the specified fields are present- Parameters:
aSearchFieldNames- The field names to search.- Returns:
trueif no entry for any of the specified fields is present
-
hasEntryForField
Check if any entry for the specified field is present- Parameters:
sSearchFieldName- The field name to search.- Returns:
trueif an entry for the specified field is present
-
hasEntryForField
default boolean hasEntryForField(@Nullable String sSearchFieldName, @Nullable IErrorLevel aErrorLevel) Check if any entry for the specified field and the specified error level is present- Parameters:
sSearchFieldName- The field name to search.aErrorLevel- The exact form error level to search. May not benull- Returns:
trueif an entry for the specified field is present that has exactly the specified form error level
-
hasErrorForField
Check if any error entry for the specified field is present- Parameters:
sSearchFieldName- The field name to search.- Returns:
trueif an error entry for the specified field is present
-
hasEntryForFields
Check if any entry for the specified fields are present- Parameters:
aSearchFieldNames- The field names to search.- Returns:
trueif an entry for at least one of the specified fields is present
-
getListOfField
Get a sub-list with all entries for the specified field name- Parameters:
sSearchFieldName- The field name to search.- Returns:
- Never
null.
-
getListOfFields
@Nonnull @ReturnsMutableCopy default IErrorList getListOfFields(@Nullable String... aSearchFieldNames) Get a sub-list with all entries for the specified field names- Parameters:
aSearchFieldNames- The field names to search.- Returns:
- Never
null.
-
getListOfFields
@Nonnull @ReturnsMutableCopy default IErrorList getListOfFields(@Nullable Collection<String> aSearchFieldNames) Get a sub-list with all entries for the specified field names- Parameters:
aSearchFieldNames- The field names to search.- Returns:
- Never
null.
-
getListOfFieldsStartingWith
@Nonnull @ReturnsMutableCopy default IErrorList getListOfFieldsStartingWith(@Nullable String... aSearchFieldNames) Get a sub-list with all entries that have field names starting with one of the supplied names.- Parameters:
aSearchFieldNames- The field names to search.- Returns:
- Never
null.
-
getListOfFieldsRegExp
@Nonnull @ReturnsMutableCopy default IErrorList getListOfFieldsRegExp(@Nonnull @Nonempty @RegEx String sRegExp) Get a sub-list with all entries that have field names matching the passed regular expression.- Parameters:
sRegExp- The regular expression to compare the entries against.- Returns:
- Never
null.
-
getListWithoutField
Get a sub-list with all entries that does not contain an error field name.- Returns:
- Never
null.
-
getAllFailures
Get a resource error group containing only the failure elements. All error levels exceptEErrorLevel.SUCCESSare considered to be a failure!- Returns:
- A non-
nullerror list containing only the failures.
-
getAllErrors
Get a resource error group containing only the error elements. All error levels ≥EErrorLevel.ERRORare considered to be an error!- Returns:
- A non-
nullerror list containing only the errors.
-
getSubList
Get a sub-list with all entries that match the provided predicate.- Parameters:
aFilter- The filter to be used. May benullin which a copy is returned.- Returns:
- Never
null.
-
getAllTexts
@Nonnull @ReturnsMutableCopy default ICommonsList<String> getAllTexts(@Nonnull Locale aContentLocale) Get a list with all contained texts.- Parameters:
aContentLocale- The content locale to used. May not benull.- Returns:
- Never
null.
-
getAllDataItems
@Nonnull @ReturnsMutableCopy default <T> ICommonsList<T> getAllDataItems(@Nonnull Function<? super IError, ? extends T> aExtractor) Get a list with only a single data element.- Type Parameters:
T- Type to extract fromIError.- Parameters:
aExtractor- The data extractor to be used. May not benull.- Returns:
- Never
null.
-
getGroupedByID
- Returns:
- A map with all items mapped from error ID to its occurrences.
-
getGroupedByFieldName
@Nonnull @ReturnsMutableCopy default ICommonsMap<String,ICommonsList<IError>> getGroupedByFieldName()- Returns:
- A map with all items mapped from error field name to its occurrences.
-
getGrouped
@Nonnull @ReturnsMutableCopy default <T> ICommonsOrderedMap<T,ICommonsList<IError>> getGrouped(@Nonnull Function<? super IError, T> aKeyExtractor) - Type Parameters:
T- Return list key type- Parameters:
aKeyExtractor- the key extractor by which the result is grouped.- Returns:
- A map with all items mapped from a key to its occurrences.
-