Class TypeFinder<T>

  • Type Parameters:
    T - the type

    public class TypeFinder<T>
    extends java.lang.Object
    The finder class for Type
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    Type
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TypeFinder.Include
      The enumeration for the type finder includes
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeFinder​(T type, java.util.function.Function<T,​T> getSuperClassFunction, java.util.function.Function<T,​T[]> getInterfacesFunction, boolean includeSelf, boolean includeHierarchicalTypes, boolean includeSuperclass, boolean includeInterfaces)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addSuperTypes​(java.util.List<T> allTypes, T type, boolean includeHierarchicalTypes, boolean includeSuperclass, boolean includeInterfaces)  
      static TypeFinder<java.lang.Class<?>> classFinder​(java.lang.Class type, boolean includeSelf, boolean includeHierarchicalTypes, boolean includeSuperclass, boolean includeInterfaces)  
      static TypeFinder<java.lang.Class<?>> classFinder​(java.lang.Class type, TypeFinder.Include... includes)  
      protected java.util.List<T> doFindTypes​(java.util.function.Predicate<? super T>[] typeFilters)  
      java.util.List<T> findTypes​(java.util.function.Predicate<? super T>... typeFilters)  
      static TypeFinder<java.lang.reflect.Type> genericTypeFinder​(java.lang.reflect.Type type, boolean includeSelf, boolean includeHierarchicalTypes, boolean includeSuperclass, boolean includeInterfaces)  
      static TypeFinder<java.lang.reflect.Type> genericTypeFinder​(java.lang.reflect.Type type, TypeFinder.Include... includes)  
      protected T[] getInterfaces​(T type)  
      protected T getSuperClass​(T type)  
      protected java.util.List<T> getSuperTypes​(T type, boolean includeSuperclass, boolean includedGenericInterfaces)  
      java.util.List<T> getTypes()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TypeFinder

        public TypeFinder​(T type,
                          java.util.function.Function<T,​T> getSuperClassFunction,
                          java.util.function.Function<T,​T[]> getInterfacesFunction,
                          boolean includeSelf,
                          boolean includeHierarchicalTypes,
                          boolean includeSuperclass,
                          boolean includeInterfaces)
    • Method Detail

      • getTypes

        public java.util.List<T> getTypes()
      • findTypes

        public java.util.List<T> findTypes​(java.util.function.Predicate<? super T>... typeFilters)
      • doFindTypes

        protected java.util.List<T> doFindTypes​(java.util.function.Predicate<? super T>[] typeFilters)
      • getSuperTypes

        protected java.util.List<T> getSuperTypes​(T type,
                                                  boolean includeSuperclass,
                                                  boolean includedGenericInterfaces)
      • getSuperClass

        protected T getSuperClass​(T type)
      • getInterfaces

        protected T[] getInterfaces​(T type)
      • addSuperTypes

        protected void addSuperTypes​(java.util.List<T> allTypes,
                                     T type,
                                     boolean includeHierarchicalTypes,
                                     boolean includeSuperclass,
                                     boolean includeInterfaces)
      • classFinder

        public static TypeFinder<java.lang.Class<?>> classFinder​(java.lang.Class type,
                                                                 boolean includeSelf,
                                                                 boolean includeHierarchicalTypes,
                                                                 boolean includeSuperclass,
                                                                 boolean includeInterfaces)
      • genericTypeFinder

        public static TypeFinder<java.lang.reflect.Type> genericTypeFinder​(java.lang.reflect.Type type,
                                                                           TypeFinder.Include... includes)
      • genericTypeFinder

        public static TypeFinder<java.lang.reflect.Type> genericTypeFinder​(java.lang.reflect.Type type,
                                                                           boolean includeSelf,
                                                                           boolean includeHierarchicalTypes,
                                                                           boolean includeSuperclass,
                                                                           boolean includeInterfaces)