Home
last modified time | relevance | path

Searched refs:asTypeName (Results 1 – 25 of 29) sorted by relevance

12

/external/kotlinpoet/kotlinpoet/src/test/java/com/squareup/kotlinpoet/
DLambdaTypeNameTest.kt36 returnType = Unit::class.asTypeName(), in receiverWithoutAnnotationHasNoParens()
48 returnType = Unit::class.asTypeName(), in receiverWithAnnotationHasParens()
57 receiver = Int::class.asTypeName(), in contextReceiver()
59 returnType = Unit::class.asTypeName(), in contextReceiver()
69 receiver = Int::class.asTypeName(), in nullableFunctionWithContextReceiver()
71 returnType = Unit::class.asTypeName(), in nullableFunctionWithContextReceiver()
81 receiver = Int::class.asTypeName(), in suspendingFunctionWithContextReceiver()
83 returnType = Unit::class.asTypeName(), in suspendingFunctionWithContextReceiver()
93 Int::class.asTypeName(), in functionWithMultipleContextReceivers()
95 Unit::class.asTypeName(), in functionWithMultipleContextReceivers()
[all …]
DAbstractTypesTest.kt49 assertThat(getMirror(Any::class.java).asTypeName()) in getElement()
51 assertThat(getMirror(Charset::class.java).asTypeName()) in getElement()
53 assertThat(getMirror(AbstractTypesTest::class.java).asTypeName()) in getElement()
59 assertThat(setType.asTypeName()) in getParameterizedTypeMirror()
65 assertThat(errorType.asTypeName()).isEqualTo(Set::class.asClassName()) in getErrorType()
86 assertThat(typeVariables[0].asType().asTypeName()) in getTypeVariableTypeMirror()
88 assertThat(typeVariables[1].asType().asTypeName()) in getTypeVariableTypeMirror()
90 assertThat(typeVariables[2].asType().asTypeName()) in getTypeVariableTypeMirror()
92 assertThat(typeVariables[3].asType().asTypeName()) in getTypeVariableTypeMirror()
94 assertThat(typeVariables[4].asType().asTypeName()) in getTypeVariableTypeMirror()
[all …]
DParameterizedTypeNameTest.kt46 val mapOfT = Map::class.asTypeName().plusParameter(t) in classNamePlusTypeVariableParameter()
68 assertThat(ByteArray::class.asTypeName().toString()).isEqualTo("kotlin.ByteArray") in primitiveArray()
69 assertThat(CharArray::class.asTypeName().toString()).isEqualTo("kotlin.CharArray") in primitiveArray()
70 assertThat(ShortArray::class.asTypeName().toString()).isEqualTo("kotlin.ShortArray") in primitiveArray()
71 assertThat(IntArray::class.asTypeName().toString()).isEqualTo("kotlin.IntArray") in primitiveArray()
72 assertThat(LongArray::class.asTypeName().toString()).isEqualTo("kotlin.LongArray") in primitiveArray()
73 assertThat(FloatArray::class.asTypeName().toString()).isEqualTo("kotlin.FloatArray") in primitiveArray()
74 assertThat(DoubleArray::class.asTypeName().toString()).isEqualTo("kotlin.DoubleArray") in primitiveArray()
79 val typeName = Array<Unit>::class.createType(listOf(invariantInt)).asTypeName() in arrayPlusPrimitiveParameter()
85 val typeName = Array<Unit>::class.createType(listOf(invariantCloseable)).asTypeName() in arrayPlusObjectParameter()
[all …]
DAnnotatedTypeNameTest.kt33 val simpleString = String::class.asTypeName() in annotated()
35 assertEquals(simpleString, String::class.asTypeName()) in annotated()
42 val type = String::class.asTypeName() in annotatedType()
49 val type = String::class.asTypeName() in annotatedTwice()
68 val type = String::class.asTypeName().copy(annotations = listOf(NEVER_NULL)) in annotatedArgumentOfParameterizedType()
76 val type = String::class.asTypeName().copy(annotations = listOf(NEVER_NULL)) in annotatedWildcardTypeNameWithSuper()
83 val type = String::class.asTypeName().copy(annotations = listOf(NEVER_NULL)) in annotatedWildcardTypeNameWithExtends()
124 val type = Map.Entry::class.asTypeName().copy(annotations = listOf(typeUseAnnotation)) in annotatedNestedType()
DKotlinPoetTest.kt131 PropertySpec.builder("cilantro", String::class.asTypeName()) in primaryConstructorProperties()
184 PropertySpec.builder("sauce", String::class.asTypeName(), KModifier.PUBLIC) in propertyModifiers()
431 returnType = String::class.asTypeName(), in extensionFunctionLambda()
585 PropertySpec.builder("propertyWithCustomAccessors", Int::class.asTypeName()) in getAndSet()
651 PropertySpec.builder("q", String::class.asTypeName()) in stackedPropertyModifiers()
669 PropertySpec.builder("q", String::class.asTypeName()) in stackedPropertyModifiers()
921 List::class.asTypeName() in importTypeArgumentInParameterizedTypeName()
922 .parameterizedBy(Int::class.asTypeName().jvmSuppressWildcards()), in importTypeArgumentInParameterizedTypeName()
DTypeSpecTest.kt1021 .addTypeVariable(p.copy(bounds = p.bounds + listOf(Comparable::class.asTypeName()))) in typeVariableWithBounds()
1022 .addTypeVariable(q.copy(bounds = q.bounds + listOf(Comparable::class.asTypeName()))) in typeVariableWithBounds()
2754 Serializable::class.asTypeName(), in multipleSuperinterfaceAddition()
2755 EventListener::class.asTypeName(), in multipleSuperinterfaceAddition()
2974 val typeName = String::class.asTypeName() in typeFromTypeName()
3826 val type = String::class.asTypeName() in importNonNullableProperty()
3940 .builder("b", String::class.asTypeName().copy(nullable = true)) in constructorWithDefaultParamValue()
3952 PropertySpec.builder("b", String::class.asTypeName().copy(nullable = true)) in constructorWithDefaultParamValue()
3978 .addParameter("a", String::class.asTypeName().copy(nullable = true)) in constructorDelegation()
3979 .addParameter("b", String::class.asTypeName().copy(nullable = true)) in constructorDelegation()
[all …]
DFunSpecTest.kt165 .builder("string", String::class.asTypeName().copy(nullable = true)) in nullableParam()
180 .returns(String::class.asTypeName().copy(nullable = true)) in nullableReturnType()
250 ParameterSpec.builder("string", String::class.asTypeName()) in functionParamWithKdoc()
255 ParameterSpec.builder("number", Int::class.asTypeName()) in functionParamWithKdoc()
259 .addParameter(ParameterSpec.builder("nodoc", Boolean::class.asTypeName()).build()) in functionParamWithKdoc()
285 ParameterSpec.builder("string", String::class.asTypeName()) in functionParamWithKdocToBuilder()
DPropertySpecTest.kt186 val prop = PropertySpec.builder("foo", String::class.asTypeName()) in inlineBothAccessors()
435 PropertySpec.builder("property", String::class.asTypeName()) in reifiedTypeVariableNotAllowedWhenSetterNotInline()
452 PropertySpec.builder("property", String::class.asTypeName()) in reifiedTypeVariableNotAllowedWhenOnlySetterIsInline()
475 PropertySpec.builder("property", String::class.asTypeName()) in setterNotAllowedWhenPropertyIsNotMutable()
DCodeBlockTest.kt229 val type = String::class.asTypeName().copy(nullable = true) in nullableType()
234 .parameterizedBy(Int::class.asTypeName().copy(nullable = true)) in nullableType()
240 .parameterizedBy(String::class.asTypeName().copy(nullable = true), list) in nullableType()
246 val rarr = WildcardTypeName.producerOf(String::class.asTypeName().copy(nullable = true)) in nullableType()
DCrossplatformTest.kt61 val actualName = AtomicReference::class.asTypeName().parameterizedBy(expectTypeParam) in crossplatform()
DTypeVariableNameTest.kt131 .addTypeVariable(TypeVariableName("T").copy(bounds = listOf(Number::class.asTypeName()))) in addingBoundsRemovesImplicitBound()
/external/kotlinpoet/kotlinpoet/src/main/java/com/squareup/kotlinpoet/
DParameterizedTypeName.kt120 ParameterizedTypeName(null, asClassName(), typeArguments.map { it.asTypeName() }) in <lambda>()
128 ParameterizedTypeName(null, asClassName(), typeArguments.map { it.asTypeName() }) in <lambda>()
143 ParameterizedTypeName(null, asClassName(), typeArguments.map { it.asTypeName() }) in <lambda>()
151 ParameterizedTypeName(null, asClassName(), typeArguments.map { it.asTypeName() }) in <lambda>()
203 return type.asTypeName().run { if (nullable) copy(nullable = true) else this } in <lambda>()
213 effectiveType.asTypeName(), in <lambda>()
215 val typeName = paramType?.asTypeName() ?: return@map STAR in <lambda>()
243 public fun KType.asTypeName(): TypeName { in asParameterizedTypeName() method
DParameterSpec.kt168 val type = element.asType().asTypeName() in <lambda>()
190 builder(name, type.asTypeName(), *modifiers) in <lambda>()
196 ): Builder = builder(name, type.asTypeName(), *modifiers) in <lambda>()
210 ): Builder = builder(name, type.asTypeName(), modifiers) in <lambda>()
216 ): Builder = builder(name, type.asTypeName(), modifiers) in <lambda>()
218 @JvmStatic public fun unnamed(type: KClass<*>): ParameterSpec = unnamed(type.asTypeName()) in <lambda>()
220 @JvmStatic public fun unnamed(type: Type): ParameterSpec = unnamed(type.asTypeName()) in <lambda>()
DWildcardTypeName.kt70 producerOf(outType.asTypeName()) in producerOf()
73 producerOf(outType.asTypeName()) in producerOf()
88 consumerOf(inType.asTypeName()) in producerOf()
91 consumerOf(inType.asTypeName()) in producerOf()
DTypeVariableName.kt123 bounds = bounds.map(KClass<*>::asTypeName).ifEmpty(::NULLABLE_ANY_LIST), in emit()
138 bounds = bounds.map(Type::asTypeName).ifEmpty(::NULLABLE_ANY_LIST), in emit()
163 bounds.map { it.asTypeName() }.ifEmpty(::NULLABLE_ANY_LIST), in emit()
178 bounds.map { it.asTypeName() }.ifEmpty(::NULLABLE_ANY_LIST), in emit()
260 val boundsTypeNames = bounds.map(TypeMirror::asTypeName) in asTypeVariableName()
268 bounds = upperBounds.map(KType::asTypeName) in asTypeVariableName()
DFunSpec.kt406 ): Builder = receiver(receiverType.asTypeName(), kdoc) in <lambda>()
417 ): Builder = receiver(receiverType.asTypeName(), kdoc) in <lambda>()
435 returns(returnType.asTypeName(), kdoc) in <lambda>()
438 returns(returnType.asTypeName(), CodeBlock.of(kdoc, args)) in <lambda>()
443 ): Builder = returns(returnType.asTypeName(), kdoc) in <lambda>()
446 returns(returnType.asTypeName(), CodeBlock.of(kdoc, args)) in <lambda>()
500 addParameter(name, type.asTypeName(), *modifiers) in <lambda>()
503 addParameter(name, type.asTypeName(), *modifiers) in <lambda>()
509 addParameter(name, type.asTypeName(), modifiers) in <lambda>()
515 ): Builder = addParameter(name, type.asTypeName(), modifiers) in <lambda>()
[all …]
DPropertySpec.kt281 public fun receiver(receiverType: Type): Builder = receiver(receiverType.asTypeName()) in <lambda>()
283 public fun receiver(receiverType: KClass<*>): Builder = receiver(receiverType.asTypeName()) in <lambda>()
309 builder(name, type.asTypeName(), *modifiers) in <lambda>()
315 ): Builder = builder(name, type.asTypeName(), *modifiers) in <lambda>()
334 ): Builder = builder(name, type.asTypeName(), modifiers) in <lambda>()
340 ): Builder = builder(name, type.asTypeName(), modifiers) in <lambda>()
DTypeSpec.kt588 public fun superclass(superclass: Type): Builder = superclass(superclass.asTypeName()) in <lambda>()
590 public fun superclass(superclass: KClass<*>): Builder = superclass(superclass.asTypeName()) in <lambda>()
636 ): Builder = addSuperinterface(superinterface.asTypeName(), delegate) in <lambda>()
641 ): Builder = addSuperinterface(superinterface.asTypeName(), delegate) in <lambda>()
646 ): Builder = addSuperinterface(superinterface.asTypeName(), constructorParameterName) in <lambda>()
701 addProperty(name, type.asTypeName(), *modifiers) in <lambda>()
704 addProperty(name, type.asTypeName(), *modifiers) in <lambda>()
714 addProperty(name, type.asTypeName(), modifiers) in <lambda>()
717 addProperty(name, type.asTypeName(), modifiers) in <lambda>()
823 check(superclass == Any::class.asTypeName()) { in <lambda>()
DTypeName.kt333 public fun TypeMirror.asTypeName(): TypeName = TypeName.get(this, mutableMapOf()) method
337 public fun KClass<*>.asTypeName(): ClassName = asClassName() method
341 public fun Type.asTypeName(): TypeName = TypeName.get(this, mutableMapOf()) method
347 public inline fun <reified T> typeNameOf(): TypeName = typeOf<T>().asTypeName()
DCodeBlock.kt397 o.asTypeName() in <lambda>()
401 o.asType().asTypeName() in <lambda>()
403 is Type -> o.asTypeName() in <lambda>()
404 is KClass<*> -> o.asTypeName() in <lambda>()
DTypeAliasSpec.kt153 builder(name, type.asTypeName()) in <lambda>()
156 builder(name, type.asTypeName()) in <lambda>()
DAnnotationSpec.kt168 builder.add("%T.%L", c.asType().asTypeName(), c.simpleName) in <lambda>()
171 builder.add("%T::class", t.asTypeName()) in <lambda>()
/external/kotlinpoet/kotlinpoet/src/main/java/com/squareup/kotlinpoet/jvm/
DJvmAnnotations.kt29 import com.squareup.kotlinpoet.asTypeName
80 throws(exceptionClasses.map(KClass<*>::asTypeName)) in throws()
83 throws(exceptionClasses.map(Type::asTypeName)) in throws()
/external/kotlinpoet/kotlinpoet/src/test/java/com/squareup/kotlinpoet/jvm/
DJvmAnnotationsTest.kt29 import com.squareup.kotlinpoet.asTypeName
217 PropertySpec.builder("foo", String::class.asTypeName()) in jvmStaticSetter()
560 PropertySpec.builder("foo", String::class.asTypeName()) in jvmNameSetter()
714 .parameterizedBy(Int::class.asTypeName().jvmSuppressWildcards()), in jvmSuppressWildcardsType()
742 .parameterizedBy(Int::class.asTypeName().jvmWildcard()), in jvmWildcardType()
816 PropertySpec.builder("foo", String::class.asTypeName()) in synchronizedSetter()
/external/kotlinpoet/interop/kotlinx-metadata/src/main/kotlin/com/squareup/kotlinpoet/metadata/classinspectors/
DReflectiveClassInspector.kt23 import com.squareup.kotlinpoet.asTypeName in <lambda>()
221 return exceptionTypes.orEmpty().mapTo(mutableListOf()) { it.asTypeName() } in <lambda>()
225 return exceptionTypes.orEmpty().mapTo(mutableListOf()) { it.asTypeName() } in <lambda>()

12