mirror of https://github.com/sbt/sbt.git
Allow to evolve l.d.Attributes while maintaining bin compat
This commit is contained in:
parent
353e991839
commit
48f7aa41dc
|
|
@ -1,6 +1,35 @@
|
||||||
package lmcoursier.definitions
|
package lmcoursier.definitions
|
||||||
|
|
||||||
final case class Attributes(
|
final class Attributes private (
|
||||||
`type`: Type,
|
val `type`: Type,
|
||||||
classifier: Classifier
|
val classifier: Classifier
|
||||||
)
|
) {
|
||||||
|
|
||||||
|
override def equals(obj: Any): Boolean =
|
||||||
|
obj match {
|
||||||
|
case other: Attributes =>
|
||||||
|
`type` == other.`type` && classifier == other.classifier
|
||||||
|
case _ => false
|
||||||
|
}
|
||||||
|
override def hashCode(): Int =
|
||||||
|
37 * (37 * (37 * (17 + "lmcoursier.definitions.Attributes".##) + `type`.##) + classifier.##)
|
||||||
|
override def toString: String =
|
||||||
|
s"Attributes(${`type`}, $classifier)"
|
||||||
|
|
||||||
|
private def copy(
|
||||||
|
`type`: Type = `type`,
|
||||||
|
classifier: Classifier = classifier
|
||||||
|
): Attributes =
|
||||||
|
new Attributes(`type`, classifier)
|
||||||
|
|
||||||
|
def withType(`type`: Type): Attributes =
|
||||||
|
copy(`type` = `type`)
|
||||||
|
def withClassifier(classifier: Classifier): Attributes =
|
||||||
|
copy(classifier = classifier)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
object Attributes {
|
||||||
|
def apply(`type`: Type, classifier: Classifier): Attributes =
|
||||||
|
new Attributes(`type`, classifier)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue