Condition

annotation class Condition(val type: KClass<out CustomConditionChecker<*>>, val fail: Boolean = false)(source)

Meta-annotation for custom conditions.

The annotated annotation need to be in the search path

Example:

@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER)
@Condition(ProfileChecker::class, fail = false)
annotation class RequireProfile(val profile: Profile)

See also

Properties

Link copied to clipboard
val fail: Boolean = false

Whether the service creation should throw when the condition isn't met.

Link copied to clipboard

The implementation type of this condition, same as CustomConditionChecker.annotationType.