wire-kotlin-generator / com.squareup.wire.kotlin / KotlinGenerator

KotlinGenerator

class KotlinGenerator

Properties

schema

val schema: Schema

Functions

generateFileAnnotations

fun generateFileAnnotations(): List<AnnotationSpec>

generateOptionType

fun generateOptionType(extend: Extend, field: Field): TypeSpec?

Example

generateServiceTypeSpecs

fun generateServiceTypeSpecs(service: Service, onlyRpc: Rpc? = null): Map<ClassName, TypeSpec>

Generates all TypeSpecs for the given Service.

generateType

fun generateType(type: Type): TypeSpec

generatedServiceName

fun generatedServiceName(service: Service, rpc: Rpc? = null, isImplementation: Boolean = false): ClassName

Returns the full name of the class generated for service#rpc. This returns a name like RouteGuideClient or RouteGuideGetFeatureBlockingServer.

generatedTypeName

fun generatedTypeName(type: Type): ClassName

Returns the full name of the class generated for type.

fun generatedTypeName(field: Field): ClassName

Returns the full name of the class generated for field.

Companion Object Functions

invoke

operator fun invoke(schema: Schema, profile: Profile = Profile(), emitAndroid: Boolean = false, javaInterop: Boolean = false, emitDeclaredOptions: Boolean = true, emitAppliedOptions: Boolean = false, emitKotlinSerialization: Boolean = false, rpcCallStyle: RpcCallStyle = RpcCallStyle.SUSPENDING, rpcRole: RpcRole = RpcRole.CLIENT, boxOneOfsMinSize: Int = 5_000, grpcServerCompatible: Boolean = false): KotlinGenerator