@ SuppressWarnings ( "unchecked" ) public < T extends BaseTopicWrapper < T > > List < T > getAllTopics ( boolean ignoreRevisions ) { final List < T > topics = new ArrayList < T > ( ) ; for ( final Entry < Integer , List < ITopicNode > > entry : this . topics . entrySet ( ) ) { final Integer topicId = entry . getKey ( ) ; if ( ! this . topics . get ( topicId ) . isEmpty ( ) ) { if ( ignoreRevisions ) { topics . add ( ( T ) entry . getValue ( ) . get ( 0 ) . getTopic ( ) ) ; } else { final List < T > specTopicTopics = getUniqueTopicsFromSpecTopics ( entry . getValue ( ) ) ; topics . addAll ( specTopicTopics ) ; } } } return topics ; }
Get all of the Topics that exist in the database . You can either choose to ignore revisions meaning two topics with the same ID but different revisions are classed as the same topic . Or choose to take note of revisions meaning if two topics have different revisions but the same ID they are still classed as different topics .