ScalaPbOptions

scalapb.options.ScalaPbOptions
See theScalaPbOptions companion object
final case class ScalaPbOptions(packageName: Option[String], flatPackage: Option[Boolean], `import`: Seq[String], preamble: Seq[String], singleFile: Option[Boolean], noPrimitiveWrappers: Option[Boolean], primitiveWrappers: Option[Boolean], collectionType: Option[String], preserveUnknownFields: Option[Boolean], objectName: Option[String], scope: Option[OptionsScope], lenses: Option[Boolean], retainSourceCodeInfo: Option[Boolean], mapType: Option[String], noDefaultValuesInConstructor: Option[Boolean], enumValueNaming: Option[EnumValueNaming], enumStripPrefix: Option[Boolean], bytesType: Option[String], javaConversions: Option[Boolean], auxMessageOptions: Seq[AuxMessageOptions], auxFieldOptions: Seq[AuxFieldOptions], auxEnumOptions: Seq[AuxEnumOptions], auxEnumValueOptions: Seq[AuxEnumValueOptions], preprocessors: Seq[String], fieldTransformations: Seq[FieldTransformation], ignoreAllTransformations: Option[Boolean], getters: Option[Boolean], scala3Sources: Option[Boolean], testOnlyNoJavaConversions: Option[Boolean], unknownFields: UnknownFieldSet) extends GeneratedMessage, Updatable[ScalaPbOptions], ExtendableMessage[ScalaPbOptions]

Value parameters

auxEnumOptions

List of message options to apply to some enums.

auxEnumValueOptions

List of enum value options to apply to some enum values.

auxFieldOptions

List of message options to apply to some fields.

auxMessageOptions

List of message options to apply to some messages.

bytesType

Scala type to use for bytes fields.

collectionType

Scala type to be used for repeated fields. If unspecified, scala.collection.Seq will be used.

enumStripPrefix

Indicate if prefix (enum name + optional underscore) should be removed in scala code Strip is applied before enum value naming changes.

flatPackage

If true, the compiler does not append the proto base file name into the generated package name. If false (the default), the generated scala package name is the package_name.basename where basename is the proto file name without the .proto extension.

getters

If true, getters will be generated.

ignoreAllTransformations

Ignores all transformations for this file. This is meant to allow specific files to opt out from transformations inherited through package-scoped options.

import

Adds the following imports at the top of the file (this is meant to provide implicit TypeMappers)

javaConversions

Enable java conversions for this file.

lenses

If true, lenses will be generated.

mapType

Scala type to be used for maps. If unspecified, scala.collection.immutable.Map will be used.

noDefaultValuesInConstructor

If true, no default values will be generated in message constructors. This setting can be overridden at the message-level and for individual fields.

noPrimitiveWrappers

By default, wrappers defined at https://github.com/google/protobuf/blob/master/src/google/protobuf/wrappers.proto, are mapped to an Option[T] where T is a primitive type. When this field is set to true, we do not perform this transformation.

objectName

If defined, sets the name of the file-level object that would be generated. This object extends GeneratedFileObject and contains descriptors, and list of message and enum companions.

packageName

If set then it overrides the java_package and package.

preamble

Text to add to the generated scala file. This can be used only when single_file is true.

preprocessors

List of preprocessors to apply.

preserveUnknownFields

If set to true, all generated messages in this file will preserve unknown fields.

primitiveWrappers

DEPRECATED. In ScalaPB <= 0.5.47, it was necessary to explicitly enable primitive_wrappers. This field remains here for backwards compatibility, but it has no effect on generated code. It is an error to set both primitive_wrappers and no_primitive_wrappers.

retainSourceCodeInfo

If true, then source-code info information will be included in the generated code - normally the source code info is cleared out to reduce code size. The source code info is useful for extracting source code location from the descriptors as well as comments.

scala3Sources

Generate sources that are compatible with Scala 3

scope

Experimental: scope to apply the given options.

singleFile

If true, all messages and enums (but not services) will be written to a single Scala file.

testOnlyNoJavaConversions

For use in tests only. Inhibit Java conversions even when when generator parameters request for it.

Attributes

Companion
object
Graph
Supertypes
trait Updatable[ScalaPbOptions]
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def addAllImport(`__vs`: Iterable[String]): ScalaPbOptions
def addAllPreamble(`__vs`: Iterable[String]): ScalaPbOptions
def addAllPreprocessors(`__vs`: Iterable[String]): ScalaPbOptions
def addImport(`__vs`: String*): ScalaPbOptions
def addPreamble(`__vs`: String*): ScalaPbOptions
def addPreprocessors(`__vs`: String*): ScalaPbOptions
def getBytesType: String
def getCollectionType: String
def getEnumStripPrefix: Boolean
def getField(`__field`: FieldDescriptor): PValue
def getFieldByNumber(`__fieldNumber`: Int): Any
def getFlatPackage: Boolean
def getGetters: Boolean
def getJavaConversions: Boolean
def getLenses: Boolean
def getMapType: String
def getNoPrimitiveWrappers: Boolean
def getObjectName: String
def getPackageName: String
def getPrimitiveWrappers: Boolean
def getScala3Sources: Boolean
def getSingleFile: Boolean
override def serializedSize: Int

Attributes

Definition Classes
def toProtoString: String

Returns a human-readable ASCII format representation of this message.

Returns a human-readable ASCII format representation of this message.

The original message can be decoded from this format by using fromAscii on the companion object.

Attributes

Returns

human-readable representation of this message.

def withBytesType(`__v`: String): ScalaPbOptions
def withCollectionType(`__v`: String): ScalaPbOptions
def withEnumStripPrefix(`__v`: Boolean): ScalaPbOptions
def withFlatPackage(`__v`: Boolean): ScalaPbOptions
def withGetters(`__v`: Boolean): ScalaPbOptions
def withImport(`__v`: Seq[String]): ScalaPbOptions
def withJavaConversions(`__v`: Boolean): ScalaPbOptions
def withLenses(`__v`: Boolean): ScalaPbOptions
def withMapType(`__v`: String): ScalaPbOptions
def withObjectName(`__v`: String): ScalaPbOptions
def withPackageName(`__v`: String): ScalaPbOptions
def withPreamble(`__v`: Seq[String]): ScalaPbOptions
def withPreprocessors(`__v`: Seq[String]): ScalaPbOptions
def withPrimitiveWrappers(`__v`: Boolean): ScalaPbOptions
def withScala3Sources(`__v`: Boolean): ScalaPbOptions
def withSingleFile(`__v`: Boolean): ScalaPbOptions
def writeTo(`_output__`: CodedOutputStream): Unit

Serializes the message into the given coded output stream

Serializes the message into the given coded output stream

Attributes

Inherited methods

def extension[T](generatedExtension: GeneratedExtension[ScalaPbOptions, T]): T

Attributes

Inherited from:
ExtendableMessage
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
final def toByteArray: Array[Byte]

Serializes the message and returns a byte array containing its raw bytes

Serializes the message and returns a byte array containing its raw bytes

Attributes

Inherited from:
GeneratedMessage
final def toByteString: ByteString

Serializes the message and returns a ByteString containing its raw bytes

Serializes the message and returns a ByteString containing its raw bytes

Attributes

Inherited from:
GeneratedMessage
final def toPMessage: PMessage

Attributes

Inherited from:
GeneratedMessage
def update(ms: Lens[ScalaPbOptions, ScalaPbOptions] => () => ScalaPbOptions*): A

Attributes

Inherited from:
Updatable
def withExtension[T](generatedExtension: GeneratedExtension[ScalaPbOptions, T])(value: T): A

Attributes

Inherited from:
ExtendableMessage
final def writeDelimitedTo(output: OutputStream): Unit

Attributes

Inherited from:
GeneratedMessage
final def writeTo(output: OutputStream): Unit

Serializes the message into the given output stream

Serializes the message into the given output stream

Attributes

Inherited from:
GeneratedMessage