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>
- All Known Implementing Classes:
ErrorList
@MustImplementEqualsAndHashcode public interface IErrorList extends ICommonsList<IError>, IHasErrorLevels<IError>
Interface for a list ofIErrorobjects.- Since:
- 8.5.0
- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> ICommonsList<T>getAllDataItems(Function<? super IError,? extends T> aExtractor)Get a list with only a single data element.default IErrorListgetAllErrors()Get a resource error group containing only the error elements.default IErrorListgetAllFailures()Get 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>>getGroupedByFieldName()default ICommonsMap<String,ICommonsList<IError>>getGroupedByID()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 IErrorListgetListWithoutField()Get a sub-list with all entries that does not contain an error field name.IErrorListgetSubList(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 present-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface com.helger.commons.lang.ICloneable
getClone
-
Methods 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, setAllMapped
-
Methods 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, getCount
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsList
createInstance, getAll, getAllInstanceOf, getAllMapped, getAllMapped, getAsUnmodifiable, getAtIndex, getFirst, getFirst, getLast, getLast, getSortedInline, removeAndReturnElementAtIndex, removeAtIndex, removeFirst, removeLast, reverse, setFirst, setLast, swapItems
-
Methods inherited from interface com.helger.commons.error.level.IHasErrorLevels
containsAtLeastOneError, containsAtLeastOneFailure, containsAtLeastOneSuccess, containsAtLeastOneWarningOrError, containsNoError, containsNoFailure, containsNoSuccess, containsOnlyError, containsOnlyFailure, containsOnlySuccess, getErrorCount, getFailureCount, getMostSevereErrorLevel, getSuccessCount
-
Methods inherited from interface com.helger.commons.lang.IHasSize
isEmpty, isNotEmpty, size
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
hasNoEntryForField
default boolean hasNoEntryForField(@Nullable String sSearchFieldName)
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
default boolean hasNoEntryForFields(@Nullable String... aSearchFieldNames)
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
default boolean hasEntryForField(@Nullable String sSearchFieldName)
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
default boolean hasErrorForField(@Nullable String sSearchFieldName)
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
default boolean hasEntryForFields(@Nullable String... aSearchFieldNames)
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
@Nonnull @ReturnsMutableCopy default IErrorList getListOfField(@Nullable String sSearchFieldName)
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
@Nonnull @ReturnsMutableCopy default IErrorList getListWithoutField()
Get a sub-list with all entries that does not contain an error field name.- Returns:
- Never
null.
-
getAllFailures
@Nonnull default IErrorList 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
@Nonnull default IErrorList 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
@Nonnull @ReturnsMutableCopy IErrorList getSubList(@Nullable Predicate<? super IError> aFilter)
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
@Nonnull @ReturnsMutableCopy default ICommonsMap<String,ICommonsList<IError>> 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.
-
-