Javadoc and formatting changes only

Change-Id: Ic98144ddd3bb4dd71913eeb624a8ee68b14bea41
This commit is contained in:
Axel Uhl committed 2016-12-27 16:00:57 +01:00
1 parent ce6d7c0522
commit 812476a375
6 files changed
+47 -35

No files matched your search

@@ -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());
}