
com.kyleu.projectile.models.thrift.schema.ThriftIntEnum.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of projectile-parser-thrift_2.13 Show documentation
Show all versions of projectile-parser-thrift_2.13 Show documentation
Reads and transforms Thrift IDL files
The newest version!
package com.kyleu.projectile.models.thrift.schema
import com.facebook.swift.parser.model.IntegerEnum
import scala.jdk.CollectionConverters._
object ThriftIntEnum {
def fromIntEnum(e: IntegerEnum, pkg: Seq[String]) = {
ThriftIntEnum(e.getName, pkg, e.getFields.asScala.sortBy(_.getValue).toIndexedSeq.map(x => x.getName -> x.getValue.toInt))
}
}
case class ThriftIntEnum(
key: String,
pkg: Seq[String],
values: Seq[(String, Int)]
) {
override val toString = s"Int enum [${(pkg :+ key).mkString(".")}] with values [${values.mkString(", ")}]"
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy