mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-24 21:13:50 +00:00
Javadoc and formatting changes only
Change-Id: Ic98144ddd3bb4dd71913eeb624a8ee68b14bea41
This commit is contained in:
1 parent
ce6d7c0522
commit
812476a375
6 files changed
+47
-35
No files matched your search
+9
-4
@@ -7,8 +7,9 @@ import com.sap.sse.common.NoCorrespondingServiceRegisteredException;
|
||||
import com.sap.sse.common.TypeBasedServiceFinder;
|
||||
|
||||
/**
|
||||
* Only can provide the service for a single {@code type}, e.g. on smartphones with no OSGi context.
|
||||
* Optionally, a {@link #setFallbackService(Object) fallback} can be set.
|
||||
* Only can provide the service for a single {@code type}, e.g. on smartphones with no OSGi context. Optionally, a
|
||||
* {@link #setFallbackService(Object) fallback} can be set.
|
||||
*
|
||||
* @author Fredrik Teschke
|
||||
*/
|
||||
public class SingleTypeBasedServiceFinderImpl<ServiceType> implements
|
||||
@@ -30,8 +31,12 @@ TypeBasedServiceFinder<ServiceType> {
|
||||
@Override
|
||||
public ServiceType findService(String type)
|
||||
throws NoCorrespondingServiceRegisteredException {
|
||||
if (this.type.equals(type)) return service;
|
||||
if (fallback != null) return fallback;
|
||||
if (this.type.equals(type)) {
|
||||
return service;
|
||||
}
|
||||
if (fallback != null) {
|
||||
return fallback;
|
||||
}
|
||||
throw new NoCorrespondingServiceRegisteredException("Only one service registered", type, service.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user