Skip to content

Commit

Permalink
ModuleInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jtjeferreira committed Jun 17, 2024
1 parent d405085 commit dc76e6b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ package sbt.librarymanagement
final class ModuleInfo private (
val nameFormal: String,
val description: String,
val homepage: Option[java.net.URL],
val homepage: Option[java.net.URI],
val startYear: Option[Int],
val licenses: Vector[scala.Tuple2[String, java.net.URL]],
val licenses: Vector[scala.Tuple2[String, java.net.URI]],
val organizationName: String,
val organizationHomepage: Option[java.net.URL],
val organizationHomepage: Option[java.net.URI],
val scmInfo: Option[sbt.librarymanagement.ScmInfo],
val developers: Vector[sbt.librarymanagement.Developer]) extends Serializable {

Expand All @@ -28,7 +28,7 @@ final class ModuleInfo private (
override def toString: String = {
"ModuleInfo(" + nameFormal + ", " + description + ", " + homepage + ", " + startYear + ", " + licenses + ", " + organizationName + ", " + organizationHomepage + ", " + scmInfo + ", " + developers + ")"
}
private[this] def copy(nameFormal: String = nameFormal, description: String = description, homepage: Option[java.net.URL] = homepage, startYear: Option[Int] = startYear, licenses: Vector[scala.Tuple2[String, java.net.URL]] = licenses, organizationName: String = organizationName, organizationHomepage: Option[java.net.URL] = organizationHomepage, scmInfo: Option[sbt.librarymanagement.ScmInfo] = scmInfo, developers: Vector[sbt.librarymanagement.Developer] = developers): ModuleInfo = {
private[this] def copy(nameFormal: String = nameFormal, description: String = description, homepage: Option[java.net.URI] = homepage, startYear: Option[Int] = startYear, licenses: Vector[scala.Tuple2[String, java.net.URI]] = licenses, organizationName: String = organizationName, organizationHomepage: Option[java.net.URI] = organizationHomepage, scmInfo: Option[sbt.librarymanagement.ScmInfo] = scmInfo, developers: Vector[sbt.librarymanagement.Developer] = developers): ModuleInfo = {
new ModuleInfo(nameFormal, description, homepage, startYear, licenses, organizationName, organizationHomepage, scmInfo, developers)
}
def withNameFormal(nameFormal: String): ModuleInfo = {
Expand All @@ -37,19 +37,19 @@ final class ModuleInfo private (
def withDescription(description: String): ModuleInfo = {
copy(description = description)
}
def withHomepage(homepage: Option[java.net.URL]): ModuleInfo = {
def withHomepage(homepage: Option[java.net.URI]): ModuleInfo = {
copy(homepage = homepage)
}
def withStartYear(startYear: Option[Int]): ModuleInfo = {
copy(startYear = startYear)
}
def withLicenses(licenses: Vector[scala.Tuple2[String, java.net.URL]]): ModuleInfo = {
def withLicenses(licenses: Vector[scala.Tuple2[String, java.net.URI]]): ModuleInfo = {
copy(licenses = licenses)
}
def withOrganizationName(organizationName: String): ModuleInfo = {
copy(organizationName = organizationName)
}
def withOrganizationHomepage(organizationHomepage: Option[java.net.URL]): ModuleInfo = {
def withOrganizationHomepage(organizationHomepage: Option[java.net.URI]): ModuleInfo = {
copy(organizationHomepage = organizationHomepage)
}
def withScmInfo(scmInfo: Option[sbt.librarymanagement.ScmInfo]): ModuleInfo = {
Expand All @@ -62,5 +62,5 @@ final class ModuleInfo private (
object ModuleInfo {

def apply(nameFormal: String): ModuleInfo = new ModuleInfo(nameFormal)
def apply(nameFormal: String, description: String, homepage: Option[java.net.URL], startYear: Option[Int], licenses: Vector[scala.Tuple2[String, java.net.URL]], organizationName: String, organizationHomepage: Option[java.net.URL], scmInfo: Option[sbt.librarymanagement.ScmInfo], developers: Vector[sbt.librarymanagement.Developer]): ModuleInfo = new ModuleInfo(nameFormal, description, homepage, startYear, licenses, organizationName, organizationHomepage, scmInfo, developers)
def apply(nameFormal: String, description: String, homepage: Option[java.net.URI], startYear: Option[Int], licenses: Vector[scala.Tuple2[String, java.net.URI]], organizationName: String, organizationHomepage: Option[java.net.URI], scmInfo: Option[sbt.librarymanagement.ScmInfo], developers: Vector[sbt.librarymanagement.Developer]): ModuleInfo = new ModuleInfo(nameFormal, description, homepage, startYear, licenses, organizationName, organizationHomepage, scmInfo, developers)
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ implicit lazy val ModuleInfoFormat: JsonFormat[sbt.librarymanagement.ModuleInfo]
unbuilder.beginObject(__js)
val nameFormal = unbuilder.readField[String]("nameFormal")
val description = unbuilder.readField[String]("description")
val homepage = unbuilder.readField[Option[java.net.URL]]("homepage")
val homepage = unbuilder.readField[Option[java.net.URI]]("homepage")
val startYear = unbuilder.readField[Option[Int]]("startYear")
val licenses = unbuilder.readField[Vector[scala.Tuple2[String, java.net.URL]]]("licenses")
val licenses = unbuilder.readField[Vector[scala.Tuple2[String, java.net.URI]]]("licenses")
val organizationName = unbuilder.readField[String]("organizationName")
val organizationHomepage = unbuilder.readField[Option[java.net.URL]]("organizationHomepage")
val organizationHomepage = unbuilder.readField[Option[java.net.URI]]("organizationHomepage")
val scmInfo = unbuilder.readField[Option[sbt.librarymanagement.ScmInfo]]("scmInfo")
val developers = unbuilder.readField[Vector[sbt.librarymanagement.Developer]]("developers")
unbuilder.endObject()
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/contraband/librarymanagement.json
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@
"fields": [
{ "name": "nameFormal", "type": "String" },
{ "name": "description", "type": "String", "default": "\"\"", "since": "0.0.1" },
{ "name": "homepage", "type": "Option[java.net.URL]", "default": "None", "since": "0.0.1" },
{ "name": "homepage", "type": "Option[java.net.URI]", "default": "None", "since": "0.0.1" },
{ "name": "startYear", "type": "Option[Int]", "default": "None", "since": "0.0.1" },
{ "name": "licenses", "type": "scala.Tuple2[String, java.net.URL]*", "default": "Vector.empty", "since": "0.0.1" },
{ "name": "licenses", "type": "scala.Tuple2[String, java.net.URI]*", "default": "Vector.empty", "since": "0.0.1" },
{ "name": "organizationName", "type": "String", "default": "\"\"", "since": "0.0.1" },
{ "name": "organizationHomepage", "type": "Option[java.net.URL]", "default": "None", "since": "0.0.1" },
{ "name": "organizationHomepage", "type": "Option[java.net.URI]", "default": "None", "since": "0.0.1" },
{ "name": "scmInfo", "type": "Option[sbt.librarymanagement.ScmInfo]", "default": "None", "since": "0.0.1" },
{ "name": "developers", "type": "sbt.librarymanagement.Developer*", "default": "Vector.empty", "since": "0.0.1" }
]
Expand Down

0 comments on commit dc76e6b

Please sign in to comment.