Skip to content

Commit

Permalink
refactor(model)!: Rename a boolean HashAlgorithm property
Browse files Browse the repository at this point in the history
Make this start with the conventional `is` prefix.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Feb 19, 2024
1 parent 66202ad commit b4675eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions model/src/main/kotlin/HashAlgorithm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ import org.ossreviewtoolkit.utils.common.encodeHex
* An enum of supported hash algorithms. Each algorithm has one or more [aliases] associated to it, where the first
* alias is the definite name.
*/
enum class HashAlgorithm(vararg val aliases: String, val emptyValue: String, val verifiable: Boolean = true) {
enum class HashAlgorithm(vararg val aliases: String, val emptyValue: String, val isVerifiable: Boolean = true) {
/**
* No hash algorithm.
*/
NONE("", emptyValue = "", verifiable = false),
NONE("", emptyValue = "", isVerifiable = false),

/**
* An unknown hash algorithm.
*/
UNKNOWN("UNKNOWN", emptyValue = "", verifiable = false),
UNKNOWN("UNKNOWN", emptyValue = "", isVerifiable = false),

/**
* The Message-Digest 5 hash algorithm, see [MD5](http://en.wikipedia.org/wiki/MD5).
Expand Down Expand Up @@ -96,7 +96,7 @@ enum class HashAlgorithm(vararg val aliases: String, val emptyValue: String, val
/**
* The list of algorithms that can be verified.
*/
val VERIFIABLE = HashAlgorithm.entries.filter { it.verifiable }
val VERIFIABLE = HashAlgorithm.entries.filter { it.isVerifiable }

/**
* Create a hash algorithm from one of its [alias] names.
Expand Down
2 changes: 1 addition & 1 deletion model/src/test/kotlin/HashAlgorithmTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class HashAlgorithmTest : WordSpec({
}

"match the empty value for 0-byte input" {
HashAlgorithm.entries.filter { it.verifiable }.forAll {
HashAlgorithm.entries.filter { it.isVerifiable }.forAll {
it.calculate(byteArrayOf()) shouldBe it.emptyValue
}
}
Expand Down

0 comments on commit b4675eb

Please sign in to comment.