
wei-k.play-twenty-three-generator_2.11.0.2.0.source-code.Settings.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of play-twenty-three-generator_2.11 Show documentation
Show all versions of play-twenty-three-generator_2.11 Show documentation
generate over twenty three case classes play-json Reads/Writes/Format
The newest version!
package play.twentythree
final case class Settings(
packageName: String,
objectName: String,
params: Map[Int, Param]
) {
def enableAll: Settings = copy(
params = params.mapValues(_.enableAll)
)
def validate: Option[String] = {
params.values.toList.collectFirst{
case x if x.conflictFormat.nonEmpty =>
"conflict format methods " + x.conflictFormat
case x if x.conflictWrites.nonEmpty =>
"conflict writes methods " + x.conflictWrites
}
}
}
object Settings {
def withParams(params: Map[Int, Param]): Settings =
Settings(
packageName = Generate.defaultPackageName,
objectName = Generate.defaultObjectName,
params = params
)
def get(range: Iterable[Int]): Settings =
withParams(Param.params(range))
def all(range: Iterable[Int]): Settings =
withParams(Param.params(range).mapValues(_.enableAll))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy