@ SuppressWarnings ( "rawtypes" ) public static MonetaryAmountFactory getAmountFactory ( MonetaryAmountFactoryQuery query ) { return Optional . ofNullable ( monetaryAmountsSingletonQuerySpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryAmountsSingletonQuerySpi loaded, query functionality is not available." ) ) . getAmountFactory ( query ) ; }
Executes the query and returns the factory found if there is only one factory . If multiple factories match the query one is selected .