Fix get provider from string
This commit is contained in:
parent
90287298c8
commit
6bba45a697
1 changed files with 8 additions and 3 deletions
|
|
@ -20,7 +20,9 @@ public class Providers {
|
||||||
*/
|
*/
|
||||||
public static ThunderProvider getThunderProvider(String name, String apiKey) {
|
public static ThunderProvider getThunderProvider(String name, String apiKey) {
|
||||||
switch (name.toLowerCase()) {
|
switch (name.toLowerCase()) {
|
||||||
case "blitzortung" -> new BlitzortungProvider();
|
case "lightningmaps":
|
||||||
|
case "blitzortung":
|
||||||
|
return new BlitzortungProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new NoSuchProviderException(name);
|
throw new NoSuchProviderException(name);
|
||||||
|
|
@ -37,7 +39,9 @@ public class Providers {
|
||||||
*/
|
*/
|
||||||
public static WeatherProvider getWeatherProvider(String name, String apiKey) {
|
public static WeatherProvider getWeatherProvider(String name, String apiKey) {
|
||||||
switch (name.toLowerCase()) {
|
switch (name.toLowerCase()) {
|
||||||
case "openmeteo" -> new OpenMeteoProvider();
|
case "open-meteo":
|
||||||
|
case "openmeteo":
|
||||||
|
return new OpenMeteoProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new NoSuchProviderException(name);
|
throw new NoSuchProviderException(name);
|
||||||
|
|
@ -54,7 +58,8 @@ public class Providers {
|
||||||
*/
|
*/
|
||||||
public static TwilightTimeProvider getTwilightTimeProvider(String name, String apiKey) {
|
public static TwilightTimeProvider getTwilightTimeProvider(String name, String apiKey) {
|
||||||
switch (name.toLowerCase()) {
|
switch (name.toLowerCase()) {
|
||||||
case "approximate" -> new ApproximateTwilightTimeProvider();
|
case "approximate":
|
||||||
|
return new ApproximateTwilightTimeProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new NoSuchProviderException(name);
|
throw new NoSuchProviderException(name);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue