public Class locatePropertiesClassForType ( final ClassOrInterfaceType type ) { if ( cachedPropertiesClasses . containsKey ( type . getNameAsString ( ) ) ) { return cachedPropertiesClasses . get ( type . getNameAsString ( ) ) ; } val packageName = ConfigurationMetadataGenerator . class . getPackage ( ) . getName ( ) ; val reflections = new Reflections ( new ConfigurationBuilder ( ) . filterInputsBy ( s -> s != null && s . contains ( type . getNameAsString ( ) ) ) . setUrls ( ClasspathHelper . forPackage ( packageName ) ) . setScanners ( new TypeElementsScanner ( ) . includeFields ( false ) . includeMethods ( false ) . includeAnnotations ( false ) . filterResultsBy ( s -> s != null && s . endsWith ( type . getNameAsString ( ) ) ) , new SubTypesScanner ( false ) ) ) ; val clz = reflections . getSubTypesOf ( Serializable . class ) . stream ( ) . filter ( c -> c . getSimpleName ( ) . equalsIgnoreCase ( type . getNameAsString ( ) ) ) . findFirst ( ) . orElseThrow ( ( ) -> new IllegalArgumentException ( "Cant locate class for " + type . getNameAsString ( ) ) ) ; cachedPropertiesClasses . put ( type . getNameAsString ( ) , clz ) ; return clz ; }
Locate properties class for type class .