public Collection < ProductResource > getMatchingAddons ( ProductDefinition definition ) throws RepositoryBackendException { @ SuppressWarnings ( "unchecked" ) Collection < ProductResourceImpl > addonList = ( Collection < ProductResourceImpl > ) getAllResources ( ResourceType . ADDON ) ; Collection < ProductResource > matchedAddons = new ArrayList < ProductResource > ( ) ; for ( ProductResourceImpl addon : addonList ) { if ( addon . matches ( definition ) == MatchResult . MATCHED ) { matchedAddons . add ( addon ) ; } } return matchedAddons ; }
This will obtain the addons from the repository that match the specified product definition