Class AnnotationTransformation.Builder<THIS extends AnnotationTransformation.Builder<THIS>>

    • Method Detail

      • annotationPredicate

        @SafeVarargs
        private static java.util.function.Predicate<AnnotationInstance> annotationPredicate​(java.lang.Class<? extends java.lang.annotation.Annotation>... classes)
      • annotationPredicate

        private static java.util.function.Predicate<AnnotationInstance> annotationPredicate​(DotName... classes)
      • whenAnyMatch

        @SafeVarargs
        public final THIS whenAnyMatch​(java.lang.Class<? extends java.lang.annotation.Annotation>... classes)
        Adds a predicate that tests whether any of the current set of annotations is of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenAnyMatch

        public final THIS whenAnyMatch​(DotName... classes)
        Adds a predicate that tests whether any of the current set of annotations is of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenAnyMatch

        public final THIS whenAnyMatch​(java.util.List<DotName> classes)
        Adds a predicate that tests whether any of the current set of annotations is of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenAnyMatch

        public final THIS whenAnyMatch​(java.util.function.Predicate<AnnotationInstance> predicate)
        Adds a predicate that tests whether any of the current set of annotations matches the given predicate.
        Parameters:
        predicate - the predicate, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenAllMatch

        @SafeVarargs
        public final THIS whenAllMatch​(java.lang.Class<? extends java.lang.annotation.Annotation>... classes)
        Adds a predicate that tests whether all of the current set of annotations are of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenAllMatch

        public final THIS whenAllMatch​(DotName... classes)
        Adds a predicate that tests whether all of the current set of annotations are of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenAllMatch

        public final THIS whenAllMatch​(java.util.List<DotName> classes)
        Adds a predicate that tests whether all of the current set of annotations are of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenAllMatch

        public final THIS whenAllMatch​(java.util.function.Predicate<AnnotationInstance> predicate)
        Adds a predicate that tests whether all of the current set of annotations match the given predicate.
        Parameters:
        predicate - the predicate, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenNoneMatch

        @SafeVarargs
        public final THIS whenNoneMatch​(java.lang.Class<? extends java.lang.annotation.Annotation>... classes)
        Adds a predicate that tests whether none of the current set of annotations is of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenNoneMatch

        public final THIS whenNoneMatch​(DotName... classes)
        Adds a predicate that tests whether none of the current set of annotations is of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenNoneMatch

        public final THIS whenNoneMatch​(java.util.List<DotName> classes)
        Adds a predicate that tests whether none of the current set of annotations is of given classes.
        Parameters:
        classes - the annotation classes, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • whenNoneMatch

        public final THIS whenNoneMatch​(java.util.function.Predicate<AnnotationInstance> predicate)
        Adds a predicate that tests whether none of the current set of annotations matches the given predicate.
        Parameters:
        predicate - the predicate, must not be null
        Returns:
        this builder
        See Also:
        when(Predicate)
      • when

        public THIS when​(java.util.function.Predicate<AnnotationTransformation.TransformationContext> predicate)
        Adds a predicate to the list of predicates that will be tested before applying the transformation. If some of the predicates returns false, the transformation is not applied. In other words, the predicates are combined using logical and (conjunction).
        Parameters:
        predicate - the predicate, must not be null
        Returns:
        this builder
      • transform

        public AnnotationTransformation transform​(java.util.function.Consumer<AnnotationTransformation.TransformationContext> transformation)
        Builds an annotation transformation based on the given transformation function.
        Parameters:
        transformation - the transformation function, must not be null
        Returns:
        the built annotation transformation, never null