ru.makkarpov.scalingua.pofile.parse.ParseUtils.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scalingua_sjs1_2.12 Show documentation
Show all versions of scalingua_sjs1_2.12 Show documentation
A simple gettext-like internationalization library for Scala
The newest version!
package ru.makkarpov.scalingua.pofile.parse
import scala.collection.mutable
object ParseUtils {
// Interfacing with Scala from Java can be very unfriendly, so here are the utility methods for it.
def none[T]: Option[T] = None
def some[T](x: T): Option[T] = Option(x)
def newBuilder[T]: mutable.Builder[T, scala.collection.immutable.Seq[T]] = Vector.newBuilder[T]
def add[T](b: mutable.Builder[T, scala.collection.immutable.Seq[T]], x: T): Unit = b += x
}