Condition

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

Meta-annotation for custom conditions.

Note: This annotation needs to be directly used, and can be used multiple times by using @Repeatable.

Example:

@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.ANNOTATION_CLASS)
@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.