Skip to content

Package: MuenzwurfDefaultStrategyFactoryProvider

MuenzwurfDefaultStrategyFactoryProvider

nameinstructionbranchcomplexitylinemethod
MuenzwurfDefaultStrategyFactoryProvider()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getStrategyFactories()
M: 0 C: 17
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * Copyright © 2021-2023 Fachhochschule für die Wirtschaft (FHDW) Hannover
3: *
4: * This file is part of ipspiel24-demo.
5: *
6: * Ipspiel24-demo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
7: * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
8: * version.
9: *
10: * Ipspiel24-demo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
11: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public License along with ipspiel24-demo. If not, see
14: * <http://www.gnu.org/licenses/>.
15: */
16: package de.fhdw.gaming.ipspiel24.muenzwurf.core.domain.factory;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20: import java.util.ServiceLoader;
21:
22: /**
23: * Implements {@link MuenzwurfStrategyFactoryProvider} by using the {@link ServiceLoader}.
24: */
25: public final class MuenzwurfDefaultStrategyFactoryProvider implements MuenzwurfStrategyFactoryProvider {
26:
27: @Override
28: public List<MuenzwurfStrategyFactory> getStrategyFactories() {
29: final ServiceLoader<MuenzwurfStrategyFactory> services = ServiceLoader.load(MuenzwurfStrategyFactory.class);
30: final List<MuenzwurfStrategyFactory> list = new ArrayList<>();
31: services.iterator().forEachRemaining(list::add);
32: return list;
33: }
34: }