private String findParentFqcn ( TypeElement typeElement , Set < String > parents ) { TypeMirror type ; while ( true ) { type = typeElement . getSuperclass ( ) ; if ( type . getKind ( ) == TypeKind . NONE ) { return null ; } typeElement = ( TypeElement ) ( ( DeclaredType ) type ) . asElement ( ) ; if ( parents . contains ( typeElement . toString ( ) ) ) { String packageName = getPackageName ( typeElement ) ; return packageName + "." + getClassName ( typeElement , packageName ) ; } } }
Finds the parent barbershop type in the supplied set if any .