Skip to content

Commit

Permalink
rename poet super types
Browse files Browse the repository at this point in the history
  • Loading branch information
jangalinski committed Aug 29, 2024
1 parent 113c781 commit e2ab1bf
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import kotlin.reflect.KClass
class FileSpecBuilder(
override val builder: FileSpec.Builder
) : PoetSpecBuilder<FileSpecBuilder, FileSpec.Builder, FileSpec, FileSpecSupplier>,
AnnotatableBuilder<FileSpecBuilder>,
MemberSpecHolderBuilder<FileSpecBuilder>,
TypeSpecHolderBuilder<FileSpecBuilder>,
PoetAnnotatableBuilder<FileSpecBuilder>,
PoetMemberSpecHolderBuilder<FileSpecBuilder>,
PoetTypeSpecHolderBuilder<FileSpecBuilder>,
WithClassName {
companion object {
internal fun FileSpec.Builder.wrap() = FileSpecBuilder(this)
Expand Down
8 changes: 4 additions & 4 deletions kotlin-code-generation/src/main/kotlin/poet/FunSpecBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import kotlin.reflect.KClass
class FunSpecBuilder(
override val builder: FunSpec.Builder
) : PoetSpecBuilder<FunSpecBuilder, FunSpec.Builder, FunSpec, FunSpecSupplier>,
AnnotatableBuilder<FunSpecBuilder>,
ContextReceivableBuilder<FunSpecBuilder>,
DocumentableBuilder<FunSpecBuilder>,
OriginatingElementsHolderBuilder<FunSpecBuilder> {
PoetAnnotatableBuilder<FunSpecBuilder>,
PoetContextReceivableBuilder<FunSpecBuilder>,
PoetDocumentableBuilder<FunSpecBuilder>,
PoetOriginatingElementsHolderBuilder<FunSpecBuilder> {
companion object {
fun FunSpec.Builder.wrap() = FunSpecBuilder(this)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import kotlin.reflect.KClass
class ParameterSpecBuilder(
override val builder: ParameterSpec.Builder
) : PoetSpecBuilder<ParameterSpecBuilder, ParameterSpec.Builder, ParameterSpec, ParameterSpecSupplier>,
AnnotatableBuilder<ParameterSpecBuilder>,
DocumentableBuilder<ParameterSpecBuilder> {
PoetAnnotatableBuilder<ParameterSpecBuilder>,
PoetDocumentableBuilder<ParameterSpecBuilder> {
companion object {
fun ParameterSpec.Builder.wrap() = ParameterSpecBuilder(this)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import kotlin.reflect.KClass
class PropertySpecBuilder(
override val builder: PropertySpec.Builder
) : PoetSpecBuilder<PropertySpecBuilder, PropertySpec.Builder, PropertySpec, PropertySpecSupplier>,
AnnotatableBuilder<PropertySpecBuilder>,
ContextReceivableBuilder<PropertySpecBuilder>,
DocumentableBuilder<PropertySpecBuilder>,
OriginatingElementsHolderBuilder<PropertySpecBuilder> {
PoetAnnotatableBuilder<PropertySpecBuilder>,
PoetContextReceivableBuilder<PropertySpecBuilder>,
PoetDocumentableBuilder<PropertySpecBuilder>,
PoetOriginatingElementsHolderBuilder<PropertySpecBuilder> {
companion object {
fun PropertySpec.Builder.wrap() = PropertySpecBuilder(builder = this)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import kotlin.reflect.KClass
class TypeAliasSpecBuilder(
override val builder: TypeAliasSpec.Builder
) : PoetSpecBuilder<TypeAliasSpecBuilder, TypeAliasSpec.Builder, TypeAliasSpec, TypeAliasSpecSupplier>,
AnnotatableBuilder<TypeAliasSpecBuilder>,
DocumentableBuilder<TypeAliasSpecBuilder> {
PoetAnnotatableBuilder<TypeAliasSpecBuilder>,
PoetDocumentableBuilder<TypeAliasSpecBuilder> {
companion object {
fun TypeAliasSpec.Builder.wrap() = TypeAliasSpecBuilder(builder = this)

Expand Down
12 changes: 6 additions & 6 deletions kotlin-code-generation/src/main/kotlin/poet/TypeSpecBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import kotlin.reflect.KClass
class TypeSpecBuilder(
override val builder: TypeSpec.Builder
) : PoetSpecBuilder<TypeSpecBuilder, TypeSpec.Builder, TypeSpec, TypeSpecSupplier>,
AnnotatableBuilder<TypeSpecBuilder>,
ContextReceivableBuilder<TypeSpecBuilder>,
DocumentableBuilder<TypeSpecBuilder>,
MemberSpecHolderBuilder<TypeSpecBuilder>,
OriginatingElementsHolderBuilder<TypeSpecBuilder>,
TypeSpecHolderBuilder<TypeSpecBuilder> {
PoetAnnotatableBuilder<TypeSpecBuilder>,
PoetContextReceivableBuilder<TypeSpecBuilder>,
PoetDocumentableBuilder<TypeSpecBuilder>,
PoetMemberSpecHolderBuilder<TypeSpecBuilder>,
PoetOriginatingElementsHolderBuilder<TypeSpecBuilder>,
PoetTypeSpecHolderBuilder<TypeSpecBuilder> {

companion object {
internal fun TypeSpec.Builder.wrap() = TypeSpecBuilder(builder = this)
Expand Down
12 changes: 6 additions & 6 deletions kotlin-code-generation/src/main/kotlin/poet/_types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sealed interface PoetSpecBuilder<SELF : PoetSpecBuilder<SELF, BUILDER, SPEC, SUP
/**
* Typesafe wrapper for [Annotatable.Builder].
*/
sealed interface AnnotatableBuilder<SELF> {
sealed interface PoetAnnotatableBuilder<SELF> {

fun addAnnotation(annotationSpec: AnnotationSpec): SELF

Expand All @@ -46,7 +46,7 @@ sealed interface AnnotatableBuilder<SELF> {
/**
* Typesafe wrapper for [TypeSpecHolder.Builder].
*/
sealed interface TypeSpecHolderBuilder<SELF> {
sealed interface PoetTypeSpecHolderBuilder<SELF> {
fun addType(typeSpec: TypeSpec): SELF

fun addTypes(typeSpecs: Iterable<TypeSpec>): SELF
Expand All @@ -55,7 +55,7 @@ sealed interface TypeSpecHolderBuilder<SELF> {
/**
* Typesafe wrapper for [MemberSpecHolder.Builder].
*/
sealed interface MemberSpecHolderBuilder<SELF> {
sealed interface PoetMemberSpecHolderBuilder<SELF> {
fun addFunction(funSpec: FunSpec): SELF
fun addFunctions(funSpecs: Iterable<FunSpec>): SELF

Expand All @@ -71,22 +71,22 @@ sealed interface MemberSpecHolderBuilder<SELF> {
/**
* Typesafe wrapper for [OriginatingElementsHolder.Builder].
*/
sealed interface OriginatingElementsHolderBuilder<SELF> {
sealed interface PoetOriginatingElementsHolderBuilder<SELF> {
fun addOriginatingElement(originatingElement: Element): SELF
}

/**
* Typesafe wrapper for [ContextReceivable.Builder].
*/
sealed interface ContextReceivableBuilder<SELF> {
sealed interface PoetContextReceivableBuilder<SELF> {
fun contextReceivers(receiverTypes: Iterable<TypeName>): SELF
fun contextReceivers(vararg receiverTypes: TypeName): SELF
}

/**
* Typesafe wrapper for [Documentable.Builder].
*/
sealed interface DocumentableBuilder<SELF> {
sealed interface PoetDocumentableBuilder<SELF> {
fun addKdoc(format: String, vararg args: Any): SELF
fun addKdoc(block: CodeBlock): SELF
}

0 comments on commit e2ab1bf

Please sign in to comment.