public static final String toPojoName ( String name , String prefix , String suffix ) { LinkedList < String > parts = new LinkedList <> ( Arrays . asList ( name . split ( SPLITTER_REGEX ) ) ) ; if ( parts . isEmpty ( ) ) { return prefix + name + suffix ; } if ( parts . getFirst ( ) . equals ( "I" ) ) { parts . removeFirst ( ) ; } if ( parts . getFirst ( ) . equals ( "Abstract" ) ) { parts . removeFirst ( ) ; } if ( parts . getLast ( ) . equals ( "Interface" ) ) { parts . removeLast ( ) ; } String candidate = join ( parts , "" ) ; if ( name . equals ( candidate ) ) { return prefix + name + suffix ; } return candidate ; }
Converts a name of an interface or abstract class to Pojo name . Remove leading I and Abstract or trailing Interface .