mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 19:20:04 +00:00
bug3552: refactored Mark.color from String to Color
Change-Id: Iddcc26de68dd5c1ecd3fdcbb61e59810e879ae37
This commit is contained in:
1 parent
8f201503fb
commit
b11dca244e
36 files changed
+148
-122
No files matched your search
+2
-1
@@ -1,6 +1,7 @@
|
||||
package com.sap.sailing.domain.base;
|
||||
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sse.common.Color;
|
||||
import com.sap.sse.common.IsManagedByCache;
|
||||
|
||||
|
||||
@@ -12,7 +13,7 @@ import com.sap.sse.common.IsManagedByCache;
|
||||
*
|
||||
*/
|
||||
public interface Mark extends ControlPoint, IsManagedByCache<SharedDomainFactory> {
|
||||
public String getColor();
|
||||
public Color getColor();
|
||||
public String getShape();
|
||||
public String getPattern();
|
||||
public MarkType getType();
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@ import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.base.configuration.DeviceConfigurationMatcher;
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sailing.domain.common.PassingInstruction;
|
||||
import com.sap.sse.common.Color;
|
||||
|
||||
public interface SharedDomainFactory extends CompetitorFactory {
|
||||
|
||||
@@ -44,12 +45,12 @@ public interface SharedDomainFactory extends CompetitorFactory {
|
||||
* in that case. Otherwise, a new {@link Mark} is created with <code>color</code> as its {@link Mark#getColor()}
|
||||
* and <code>shape</code> as its {@link Mark#getShape()}.
|
||||
*/
|
||||
Mark getOrCreateMark(Serializable id, String name, MarkType type, String color, String shape, String pattern);
|
||||
Mark getOrCreateMark(Serializable id, String name, MarkType type, Color color, String shape, String pattern);
|
||||
|
||||
/**
|
||||
* @see #getOrCreateMark(String, String)
|
||||
*/
|
||||
Mark getOrCreateMark(String toStringRepresentationOfID, String name, MarkType type, String color, String shape, String pattern);
|
||||
Mark getOrCreateMark(String toStringRepresentationOfID, String name, MarkType type, Color color, String shape, String pattern);
|
||||
|
||||
/**
|
||||
* @param name also uses the name as the gate's ID; if you have a real ID, use {@link #createGate(Serializable, Mark, Mark, String)} instead
|
||||
|
||||
+4
-3
@@ -6,12 +6,13 @@ import java.util.Collections;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.base.SharedDomainFactory;
|
||||
import com.sap.sailing.domain.common.MarkType;
|
||||
import com.sap.sse.common.Color;
|
||||
import com.sap.sse.common.impl.NamedImpl;
|
||||
|
||||
public class MarkImpl extends NamedImpl implements Mark {
|
||||
private static final long serialVersionUID = 1900673146064411979L;
|
||||
|
||||
private final String color;
|
||||
private final Color color;
|
||||
private final String shape;
|
||||
private final String pattern;
|
||||
private final MarkType type;
|
||||
@@ -25,7 +26,7 @@ public class MarkImpl extends NamedImpl implements Mark {
|
||||
this(id, name, MarkType.BUOY, /* color */null, /* shape */null, /* pattern */null);
|
||||
}
|
||||
|
||||
public MarkImpl(Serializable id, String name, MarkType type, String color, String shape, String pattern) {
|
||||
public MarkImpl(Serializable id, String name, MarkType type, Color color, String shape, String pattern) {
|
||||
super(name);
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
@@ -53,7 +54,7 @@ public class MarkImpl extends NamedImpl implements Mark {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColor() {
|
||||
public Color getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -174,7 +174,7 @@ public class SharedDomainFactoryImpl implements SharedDomainFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mark getOrCreateMark(Serializable id, String name, MarkType type, String color, String shape, String pattern) {
|
||||
public Mark getOrCreateMark(Serializable id, String name, MarkType type, Color color, String shape, String pattern) {
|
||||
Mark result = markCache.get(id);
|
||||
if (result == null) {
|
||||
result = new MarkImpl(id, name, type, color, shape, pattern);
|
||||
@@ -185,7 +185,7 @@ public class SharedDomainFactoryImpl implements SharedDomainFactory {
|
||||
|
||||
@Override
|
||||
public Mark getOrCreateMark(String toStringRepresentationOfID, String name, MarkType type,
|
||||
String color, String shape, String pattern) {
|
||||
Color color, String shape, String pattern) {
|
||||
Serializable id = toStringRepresentationOfID;
|
||||
if (markIdCache.containsKey(toStringRepresentationOfID)) {
|
||||
id = markIdCache.get(toStringRepresentationOfID);
|
||||
|
||||
Reference in new issue
Block a user