Bug 5085: Removed code duplications

This commit is contained in:
Steffen Schaefer
2019-12-09 09:21:40 +01:00
parent 69d76e03c5
commit a231e864a3
8 changed files with 18 additions and 72 deletions
@@ -173,8 +173,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
return builder.build();
}
// TODO copy of com.sap.sailing.domain.persistence.impl.DomainObjectFactoryImpl
private DeviceIdentifier loadDeviceId(
public static DeviceIdentifier loadDeviceId(
TypeBasedServiceFinder<DeviceIdentifierMongoHandler> deviceIdentifierServiceFinder, Document deviceId)
throws TransformationException, NoCorrespondingServiceRegisteredException {
String deviceType = (String) deviceId.get(FieldNames.DEVICE_TYPE.name());
@@ -190,8 +189,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
}
}
// TODO copy of com.sap.sailing.domain.persistence.impl.DomainObjectFactoryImpl
public Position loadPosition(Document object) {
public static Position loadPosition(Document object) {
Number latNumber = (Number) object.get(FieldNames.LAT_DEG.name());
Double lat = latNumber == null ? null : latNumber.doubleValue();
Number lngNumber = (Number) object.get(FieldNames.LNG_DEG.name());
@@ -267,8 +267,7 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
return waypointTemplateObject;
}
// TODO copy of com.sap.sailing.domain.persistence.impl.MongoObjectFactoryImpl
private String getPassingInstructions(PassingInstruction passingInstructions) {
public static String getPassingInstructions(PassingInstruction passingInstructions) {
final String passing;
if (passingInstructions != null) {
passing = passingInstructions.name();