All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.org.brightify.hyperdrive.AutoFactory.kt Maven / Gradle / Ivy

There is a newer version: 0.1.159
Show newest version
package org.brightify.hyperdrive

/**
 * Enables automatic factory generation for the annotated class, or a class containing the annotated constructor.
 *
 * When a class is annotated, a primary constructor is used to create a new instance of the class by the generated factory.
 * When a constructor is annotated, it's used to create a new instance of the class by the generated factory.
 *
 * Annotating multiple constructors or both the class and a constructor is not supported and will produce compilation errors.
 *
 * ## Future plans:
 * - The default name of the generated factory is `Factory`, but can be changed by providing a different value to the `factoryName`
 *   constructor parameter.
 * - Default parameter values.
 * - Generics.
 */
@Target(AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR)
@Retention(AnnotationRetention.SOURCE)
public annotation class AutoFactory(/*val factoryName: String = "Factory"*/)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy