Package com.optum.sourcehawk.core.result
Class ScanResult
- java.lang.Object
-
- com.optum.sourcehawk.core.result.ScanResult
-
- All Implemented Interfaces:
Serializable
public final class ScanResult extends Object implements Serializable
The result of a scan- Author:
- Brian Wyka
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScanResult.MessageDescriptorEncapsulates all of the traits of a messagestatic classScanResult.ScanResultBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScanResult.ScanResultBuilderbuilder()booleanequals(Object o)intgetErrorCount()The number of errors encountered during the scanCollection<String>getFormattedMessages()Messages formatted for reporting Format: [SEVERITY] repositoryFilePath :: messageMap<String,Collection<ScanResult.MessageDescriptor>>getMessages()All of the messages associated with the scan Key: Repository File Path Value: Collection ofScanResult.MessageDescriptorintgetWarningCount()The number of warnings encountered during the scaninthashCode()booleanisPassed()Whether or not the scan passedbooleanisPassedWithNoWarnings()Determine if the result is passed, AND has no warningsstatic ScanResultpassed()Constructs a "passed" instance ofScanResultstatic ScanResultreduce(ScanResult one, ScanResult two)Reduce twoScanResults into oneStringtoString()
-
-
-
Method Detail
-
isPassedWithNoWarnings
public boolean isPassedWithNoWarnings()
Determine if the result is passed, AND has no warnings- Returns:
- true if passed and has no warnings, false otherwise
-
passed
public static ScanResult passed()
Constructs a "passed" instance ofScanResult- Returns:
- the scan result
-
reduce
public static ScanResult reduce(ScanResult one, ScanResult two)
Reduce twoScanResults into one- Parameters:
one- the first scan resulttwo- the second scan result- Returns:
- the reduced scan result
-
builder
public static ScanResult.ScanResultBuilder builder()
-
isPassed
public boolean isPassed()
Whether or not the scan passed
-
getErrorCount
public int getErrorCount()
The number of errors encountered during the scan
-
getWarningCount
public int getWarningCount()
The number of warnings encountered during the scan
-
getMessages
public Map<String,Collection<ScanResult.MessageDescriptor>> getMessages()
All of the messages associated with the scan Key: Repository File Path Value: Collection ofScanResult.MessageDescriptor
-
getFormattedMessages
public Collection<String> getFormattedMessages()
Messages formatted for reporting Format: [SEVERITY] repositoryFilePath :: message
-
-