On this page
[Java] Annotation Type Invariant
- groovy.contracts.Invariant
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Incubating
@ClassInvariant
@AnnotationProcessorImplementation(ClassInvariantAnnotationProcessor.class)
public @interface Invariant
Represents a class-invariant.
The class-invariant defines assertions holding during the entire objects life-time.
Class-invariants are verified at runtime at the following pointcuts:
- after a constructor call
- before a method call
- after a method call
Whenever a class has a parent which itself specifies a class-invariant, that class-invariant expression is combined with the actual class's invariant (by using a logical AND).
Element Summary
Inherited Methods Summary
Element Detail
public Class value
© 2003-2022 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/4.0.0/html/gapi/groovy/contracts/Invariant.html