Package org.ossreviewtoolkit.model
Class Hash
-
- All Implemented Interfaces:
public final class HashA class that bundles a hash algorithm with its hash value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classHash.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Stringvalueprivate final HashAlgorithmalgorithmpublic final static Hash.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description Hash(String value, HashAlgorithm algorithm)
-
Method Summary
Modifier and Type Method Description final StringgetValue()The value calculated using the hash algorithm. final HashAlgorithmgetAlgorithm()The algorithm used to calculate the hash value. final StringtoSri()Return the hash in Support Subresource Integrity (SRI) format. final Booleanverify(File file)Verify that the file matches this hash. final Booleanverify(Hash hash)Verify that the provided hash matches this hash. -
-
Constructor Detail
-
Hash
Hash(String value, HashAlgorithm algorithm)
-
-
Method Detail
-
getAlgorithm
final HashAlgorithm getAlgorithm()
The algorithm used to calculate the hash value.
-
-
-
-