Add getTwilightTimeProvider to providers by name
And fix eclipse indentation
This commit is contained in:
parent
31d6873249
commit
28286df814
1 changed files with 15 additions and 4 deletions
|
@ -3,6 +3,8 @@ package eu.m724.wtapi.provider;
|
|||
import eu.m724.wtapi.provider.exception.NoSuchProviderException;
|
||||
import eu.m724.wtapi.provider.thunder.ThunderProvider;
|
||||
import eu.m724.wtapi.provider.thunder.impl.blitzortung.BlitzortungProvider;
|
||||
import eu.m724.wtapi.provider.twilight.ApproximateTwilightTimeProvider;
|
||||
import eu.m724.wtapi.provider.twilight.TwilightTimeProvider;
|
||||
import eu.m724.wtapi.provider.weather.WeatherProvider;
|
||||
import eu.m724.wtapi.provider.weather.impl.openweathermap.OpenWeatherMapProvider;
|
||||
|
||||
|
@ -10,8 +12,8 @@ public class Providers {
|
|||
|
||||
public static ThunderProvider getThunderProvider(String name, String apiKey) throws NoSuchProviderException {
|
||||
switch (name.toLowerCase()) {
|
||||
case "blitzortung":
|
||||
return new BlitzortungProvider();
|
||||
case "blitzortung":
|
||||
return new BlitzortungProvider();
|
||||
}
|
||||
|
||||
throw new NoSuchProviderException();
|
||||
|
@ -19,11 +21,20 @@ public class Providers {
|
|||
|
||||
public static WeatherProvider getWeatherProvider(String name, String apiKey) throws NoSuchProviderException {
|
||||
switch (name.toLowerCase()) {
|
||||
case "openweathermap":
|
||||
return new OpenWeatherMapProvider(apiKey);
|
||||
case "openweathermap":
|
||||
return new OpenWeatherMapProvider(apiKey);
|
||||
}
|
||||
|
||||
throw new NoSuchProviderException();
|
||||
}
|
||||
|
||||
public static TwilightTimeProvider getTwilightTimeProvider(String name, String apiKey) throws NoSuchProviderException {
|
||||
switch (name.toLowerCase()) {
|
||||
case "approximate":
|
||||
return new ApproximateTwilightTimeProvider();
|
||||
}
|
||||
|
||||
throw new NoSuchProviderException();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue