Class PurityUtils

    • Constructor Detail

      • PurityUtils

        public PurityUtils()
    • Method Detail

      • hasPurityAnnotation

        public static boolean hasPurityAnnotation​(AnnotationProvider provider,
                                                  com.sun.source.tree.MethodTree methodTree)
        Does the method methodTree have any purity annotation?
        Parameters:
        provider - how to get annotations
        methodTree - a method to test
        Returns:
        whether the method has any purity annotations
      • hasPurityAnnotation

        public static boolean hasPurityAnnotation​(AnnotationProvider provider,
                                                  javax.lang.model.element.ExecutableElement methodElement)
        Does the method methodElement have any purity annotation?
        Parameters:
        provider - how to get annotations
        methodElement - a method to test
        Returns:
        whether the method has any purity annotations
      • isDeterministic

        public static boolean isDeterministic​(AnnotationProvider provider,
                                              com.sun.source.tree.MethodTree methodTree)
        Is the method methodTree deterministic?
        Parameters:
        provider - how to get annotations
        methodTree - a method to test
        Returns:
        whether the method is deterministic
      • isDeterministic

        public static boolean isDeterministic​(AnnotationProvider provider,
                                              javax.lang.model.element.ExecutableElement methodElement)
        Is the method methodElement deterministic?
        Parameters:
        provider - how to get annotations
        methodElement - a method to test
        Returns:
        whether the method is deterministic
      • isSideEffectFree

        public static boolean isSideEffectFree​(AnnotationProvider provider,
                                               javax.lang.model.element.ExecutableElement methodElement)
        Is the method methodElement side-effect-free?

        This method does not use, and has different semantics than, AnnotationProvider.isSideEffectFree(javax.lang.model.element.ExecutableElement). This method is concerned only with standard purity annotations.

        Parameters:
        provider - how to get annotations
        methodElement - a method to test
        Returns:
        whether the method is side-effect-free
      • getPurityKinds

        public static java.util.EnumSet<Pure.Kind> getPurityKinds​(AnnotationProvider provider,
                                                                  com.sun.source.tree.MethodTree methodTree)
        Returns the purity annotations on the method methodTree.
        Parameters:
        provider - how to get annotations
        methodTree - a method to test
        Returns:
        the types of purity of the method methodTree
      • getPurityKinds

        public static java.util.EnumSet<Pure.Kind> getPurityKinds​(AnnotationProvider provider,
                                                                  javax.lang.model.element.ExecutableElement methodElement)
        Returns the purity annotations on the method methodElement.
        Parameters:
        provider - how to get annotations
        methodElement - a method to test
        Returns:
        the types of purity of the method methodElement