Class Utils


  • public class Utils
    extends Object
    • Method Detail

      • annotationSetMatches

        @SafeVarargs
        public static boolean annotationSetMatches​(Set<? extends Annotation> annotations,
                                                   Class<? extends Annotation>... annotationTypes)
        Checks if all annotations are in a given set of annotations
        Parameters:
        annotations - The annotation set
        annotationTypes - The annotations to match
        Returns:
        True if match, false otherwise
      • typeSetMatches

        public static boolean typeSetMatches​(Set<Type> types,
                                             Type... requiredTypes)
      • isExceptionInHierarchy

        public static boolean isExceptionInHierarchy​(Throwable exception,
                                                     Class<? extends Throwable> expectedException)
      • getBean

        public static <T> javax.enterprise.inject.spi.Bean<T> getBean​(javax.enterprise.inject.spi.BeanManager beanManager,
                                                                      Type beanType,
                                                                      Annotation... bindings)
      • getBeans

        public static <T> Set<javax.enterprise.inject.spi.Bean<T>> getBeans​(javax.enterprise.inject.spi.BeanManager beanManager,
                                                                            Class<T> type,
                                                                            Annotation... bindings)
      • getBeans

        public static <T> Set<javax.enterprise.inject.spi.Bean<T>> getBeans​(javax.enterprise.inject.spi.BeanManager beanManager,
                                                                            javax.enterprise.util.TypeLiteral<T> type,
                                                                            Annotation... bindings)
      • getReference

        public static <T> T getReference​(javax.enterprise.inject.spi.BeanManager beanManager,
                                         Class<T> beanType,
                                         Annotation... bindings)
      • getReference

        public static <T> T getReference​(javax.enterprise.inject.spi.BeanManager beanManager,
                                         javax.enterprise.inject.spi.Bean<T> bean)
      • getReference

        public static <T> T getReference​(javax.enterprise.inject.spi.BeanManager beanManager,
                                         javax.enterprise.inject.spi.Bean<T> bean,
                                         Type beanType)
      • evaluateValueExpression

        public static <T> T evaluateValueExpression​(BeanManagerImpl beanManager,
                                                    String expression,
                                                    Class<T> expectedType)
      • isProxy

        public static boolean isProxy​(Object proxy)
      • getActiveContext

        public static <T extends javax.enterprise.context.spi.Context> T getActiveContext​(org.jboss.weld.manager.api.WeldManager beanManager,
                                                                                          Class<T> type)
      • getDeploymentNameAsHash

        public static String getDeploymentNameAsHash​(Class<?> testClass)
      • getHashOfTestClass

        public static String getHashOfTestClass​(String testClassName)