Class AnalysisResult
java.lang.Object
org.variantsync.diffdetective.analysis.AnalysisResult
- All Implemented Interfaces:
Metadata<AnalysisResult>
The result of a
Analysis
.
This result stores various metadata and statistics that we use for the validation of our ESEC/FSE paper.
An AnalysisResult also allows to store any custom metadata or information.- Author:
- Paul Bittner
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
AnalysisResult.ResultKey<T extends Metadata<T>>
Type proxy and runtime key for the type of aMetadata
subclass. -
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private static final String
static final org.variantsync.functjonal.category.InplaceMonoid<AnalysisResult>
static final org.variantsync.functjonal.category.InplaceSemigroup<AnalysisResult>
Inplace semigroup for AnalysisResult.static final String
Placeholder name for data that is not associated to a repository or where the repository is unknown.The repo from which the results where collected. -
Constructor Summary
ConstructorDescriptionAnalysisResult
(String repoName) Creates an empty analysis result for the given repo. -
Method Summary
Modifier and TypeMethodDescription<T extends Metadata<T>>
voidappend
(AnalysisResult.ResultKey<T> resultKey, T value) Adds a new value orMetadata.append(T)
s it to the old value which is indexed byresultKey
.<T extends Metadata<T>>
Tget
(AnalysisResult.ResultKey<T> resultKey) Returns the value previously added using<T>append(org.variantsync.diffdetective.analysis.AnalysisResult.ResultKey<T>,T)
.void
reportDiffErrors
(List<DiffError> errors) Report errors (that for example occurred when parsing VariationDiffs).org.variantsync.functjonal.category.InplaceSemigroup<AnalysisResult>
Metadata should be composable.void
void
setFromSnapshot
(LinkedHashMap<String, String> snap) snapshot()
Create a key-value store of the metadata that can be used for serialization.private void
unsafeAppend
(String key, Metadata<?> value)
-
Field Details
-
NO_REPO
Placeholder name for data that is not associated to a repository or where the repository is unknown.- See Also:
-
ERROR_BEGIN
- See Also:
-
ERROR_END
- See Also:
-
repoName
The repo from which the results where collected. -
taskName
-
diffErrors
-
results
-
ISEMIGROUP
Inplace semigroup for AnalysisResult. Merges the second results values into the first result. -
IMONOID
-
-
Constructor Details
-
AnalysisResult
public AnalysisResult() -
AnalysisResult
Creates an empty analysis result for the given repo.- Parameters:
repoName
- The repo for which to collect results.
-
-
Method Details
-
get
Returns the value previously added using<T>append(org.variantsync.diffdetective.analysis.AnalysisResult.ResultKey<T>,T)
.- Type Parameters:
T
- the type of the value which was previously stored- Parameters:
resultKey
- the key which is used to identify the data and its type
-
unsafeAppend
-
append
Adds a new value orMetadata.append(T)
s it to the old value which is indexed byresultKey
.- Type Parameters:
T
- the type of the value which is appended- Parameters:
resultKey
- the key which is used to identify the data and its type- See Also:
-
semigroup
Description copied from interface:Metadata
Metadata should be composable. Composition should be inplace to optimize performance.- Specified by:
semigroup
in interfaceMetadata<AnalysisResult>
-
reportDiffErrors
Report errors (that for example occurred when parsing VariationDiffs).- Parameters:
errors
- A list of errors to report.
-
snapshot
Description copied from interface:Metadata
Create a key-value store of the metadata that can be used for serialization.- Specified by:
snapshot
in interfaceMetadata<AnalysisResult>
- Returns:
- A LinkedHashMap that stores all relevant properties to export. The return type has to be a LinkedHashMap to obtain insertion-order iteration.
-
setFromSnapshot
- Specified by:
setFromSnapshot
in interfaceMetadata<AnalysisResult>
-
setFrom
- Throws:
IOException
-