mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Clean up.
This commit is contained in:
parent
2a236605a0
commit
9097bf2fd6
1 changed files with 5 additions and 15 deletions
|
@ -85,30 +85,20 @@ class Version(val version: String, val snapshotTimestamp: String? = null): Compa
|
|||
}
|
||||
}
|
||||
|
||||
override fun compareTo(other: Version): Int {
|
||||
return comparator.compare(this, other)
|
||||
}
|
||||
override fun compareTo(other: Version) = comparator.compare(this, other)
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return (other is Version) && comparator.compare(this, other) == 0
|
||||
}
|
||||
override fun equals(other: Any?) = (other is Version) && comparator.compare(this, other) == 0
|
||||
|
||||
override fun hashCode(): Int {
|
||||
if ( hash == -1 ) hash = Arrays.hashCode(items.toTypedArray())
|
||||
return hash
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return version
|
||||
}
|
||||
override fun toString() = version
|
||||
|
||||
fun isSnapshot(): Boolean {
|
||||
return items.firstOrNull { it.isSnapshot } != null
|
||||
}
|
||||
fun isSnapshot() = items.firstOrNull { it.isSnapshot } != null
|
||||
|
||||
fun isRangedVersion(): Boolean {
|
||||
return MavenId.isRangedVersion(version)
|
||||
}
|
||||
fun isRangedVersion() = MavenId.isRangedVersion(version)
|
||||
|
||||
fun select(list: List<Version>): Version? {
|
||||
if (!(version.first() in listOf('[', '(') && version.last() in listOf(']', ')'))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue