Record Class FilterConfig
java.lang.Object
java.lang.Record
io.jenkins.plugins.analysis.core.filter.FilterConfig
- Record Components:
filters- the list of regular expression filters to apply to issuesfilesFilter- an optional path to a file that lists the files to include
- All Implemented Interfaces:
Serializable
public record FilterConfig(List<RegexpFilter> filters, String filesFilter)
extends Record
implements Serializable
Bundles filter configuration for issue scanning. Groups regex-based filters and an optional
file-based inclusion filter into a single parameter object.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFilterConfig(List<RegexpFilter> filters, String filesFilter) Creates an instance of aFilterConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefilesFilterrecord component.filters()Returns the value of thefiltersrecord component.final inthashCode()Returns a hash code value for this object.readFileNameFilter(FilePath workspace, edu.hm.hafner.util.FilteredLog log) Reads the file inclusion list from the workspace and creates aFileNameFilter.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FilterConfig
Creates an instance of aFilterConfigrecord class.- Parameters:
filters- the value for thefiltersrecord componentfilesFilter- the value for thefilesFilterrecord component
-
-
Method Details
-
readFileNameFilter
Reads the file inclusion list from the workspace and creates aFileNameFilter.Reading the list fails open: if the filter file is missing, unreadable, empty, or outside of the workspace, then an error is reported to
logand aNullFileNameFilteris returned so that no issues are removed. Publishing all issues is the safer failure mode, since a filter that silently removes everything would hide warnings rather than show too many. Builds that should fail on such a misconfiguration can enable thefailOnErroroption of the recorder, which reacts to the errors reported here.- Parameters:
workspace- the workspace path used to resolve the filter file locationlog- the log to report problems to- Returns:
- a
FileNameFilterfor the configured files, or aNullFileNameFilterif no filter file has been configured or if it cannot be read
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
filters
Returns the value of thefiltersrecord component.- Returns:
- the value of the
filtersrecord component
-
filesFilter
Returns the value of thefilesFilterrecord component.- Returns:
- the value of the
filesFilterrecord component
-